I have a grid made using a DesktopListBox, and I need to change the background color of a single cell only. Is this possible, and if so, how do I do it?
The event PaintCellBackground is your friend. You get the graphics g as well as the row and column variables.
So you can easily decide in which cell you need to paint your own background and return True.
If it is not your cell, just return False to let the system handle the painting.
Look at DesktopListBox.CellTagAt.
Why ?
You need to place there the information your code needs to decide “That’s the Cell I have to draw its Background !”…
Excepted if you want to always color background’s cell this Cell (the same).
Here’s a sample.
fill_cell.zip (4.8 KB)
Alright, thank you everyone, I have it. Especially thank you for the example, Christian.