Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Datagridview Checkbox column forecolor

$
0
0

Hello,

i'm trying to change the forecolor of a checkbox cell but this does not work. This happens while the DataRowPainted event is thrown. I'm checking a statusfield and if the status is true i want to have a green "text" in the checkbox otherwise i should be red.

It's no problem to change the background color, but foreground color seem not to be possible to change?

The code:

        If Int(iStatusCode / 4) Mod 2 = 1 Then
            Dim cbCell As DataGridViewCheckBoxCell
            cbCell = ArchiveDataGrid1.DGData.Rows(e.RowIndex).Cells("O")
            cbCell.Style.ForeColor = Drawing.Color.DarkRed

        End If

Thanks!


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>