16,722
社区成员




Private Sub dgvUserList_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles dgvUserList.CellPainting
Dim temp As String = e.Value
Select Case temp
Case "男"
e.CellStyle.BackColor = Color.DarkSeaGreen
Case "女"
e.CellStyle.BackColor = Color.Pink
End Select
End Sub
Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
' 这边你可以根据你的不同进行判断,从而设置颜色即可
end sub