Graphics reset DrawingColor


On the CellTextPaint event of the listbox, is there a way to reset the DrawingColor only?

I can achieve that with SaveState methods (before the first change of color) and RestoreState but I wanted to know if there is a way to reset the DrawingColor only to let Xojo choose the color (e.g.: color when the row is not selected and color when the row is selected).

Thank you


Hi @Julien_Courtes1

Why don’t just compare in the event if the row is selected, assigning a color in that case, and a different one if it is not?

Thank you for the reply,

but I draw some text in colors and this color remains even when the row is selected.

Does TextColor work?

Tried that but on the highlight of the row when you select it, the text remain of the color of Color.TextColor and does not switch to the highlighted text color

I was just wondering if there was a better way. SaveState and RestoreState are doing the job anyway.

Did you return true or false?

True in the event

Can you try to set a color and then return false?

Same thing, if the row is selected, the color does not update to the default