user6167266 user6167266 - 3 months ago 14x Question

Change colour of DataGridViewCheckBoxColumn?

I have the following code to add a checkbox column to my grid..

Dim excludeColumn As New DataGridViewCheckBoxColumn
With excludeColumn
.Name = "(excl)"
.DataPropertyName = "exclude"
.Width = 300
.Visible = True
.DefaultCellStyle.ForeColor = Color.LightBlue
End With

Why doesn't the colour of the
property change as required above?


You want the .BackColor property. .ForeColor changes the text color which isn't present on a checkbox column.