VB.NET 设置DataGirdlView 某一列的颜色

来源:互联网 发布:蜂窝移动数据 软件 编辑:程序博客网 时间:2024/06/06 20:53

            Dim cell As DataGridViewCell
            For i = 0 To DataGridView1.Rows.Count - 1

                cell = DataGridView1.Rows(i).Cells(4)

                If cell.Value = "已住" Then
                    DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.Yellow
                End If
            Next

原创粉丝点击