The ListBox is hilighted while pressing the arrow key to change Row (Image and Text are hilighted).
There is only one visible Row.
I added Return True and now I can see the icon (the color of the icon) but with the selected Color that are above the Icon and the Text, the selection of the Colored Icon is a bit difficult.
This is a Template Icon and the only difference between all of the templates is/are the color (sometimes one color, sometimes two colors).
Th idea is to let the user to choose based on color (it was based on my name for the color…) with a little help (my color name)
If you want to remove the highlight, you can draw a white rectangle in the CellBackgroundPaint event (don’t forget to return true).
Then, you’ll also have to make your text black, as white on white will be unreadable; draw the cell in the CellTextPaint event, turning the colour to black (and returning true).
Actually, I already draw the icon in CellBackgroundPaint, and I also already used Return True.
Oh, and my text is Black (this, I know, does not looks like that in the screen shot). The automatic hilight turns it to white, not me. The ListBox draw the Text, not me.
I have the icon in one column and the text in the other column.
Yes, I know. As soon as you highlight a row in a listbox and the highlight colour is “dark”, the OS (or framework, whatever) draws its text as white. That’s why I suggest you to draw your text manually as black in the CellTextPaint event.
you have darkmode enabled and you expect a other color?
it looks like windows 10 hi light color.
this should draw the selected backbround in own colors
Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) Handles CellBackgroundPaint as Boolean
If column = 0 Then
If Me.Selected(row) Then
g.DrawingColor = Color.Red
g.DrawingColor = Color.White
g.DrawingColor = Color.Green