# DesktopListBox Color Text and background

**URL:** <https://forum.xojo.com/t/desktoplistbox-color-text-and-background/88925>\
**Category:** Windows\
**Created:** [September 23, 2026, 1:08pm UTC](https://forum.xojo.com/t/desktoplistbox-color-text-and-background/88925 "2026-09-23T13:08:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Volbragt\_Etienne](https://forum.xojo.com/user_avatar/forum.xojo.com/volbragt_etienne/32/6530_2.png) [@Volbragt\_Etienne](https://forum.xojo.com/u/Volbragt_Etienne)\
**Post date:** [September 23, 2026, 1:08pm UTC](https://forum.xojo.com/t/desktoplistbox-color-text-and-background/88925/1 "2026-09-23T13:08:08Z")

</div>

Windows 11 - XOJO 26r2.1  
I have a DesktopListBox that has different colors for specific rows.  
When selecting a row, there are some colors where the text is no longer clearrly visible.  
What I would like to achive is that when a row is selected the text becomes white with a blue background like the default value for a selected row.  
Once the selecting changes it need to return to its previous color.

Is that possible ?

Thanks  
Regards  
Etienne

---

<div class="post-metadata">

**Author:** ![Christian\_Wheel](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_wheel/32/20536_2.png) [@Christian\_Wheel](https://forum.xojo.com/u/Christian_Wheel)\
**Post date:** [September 23, 2026, 1:33pm UTC](https://forum.xojo.com/t/desktoplistbox-color-text-and-background/88925/2 "2026-09-23T13:33:32Z")

</div>

You’re already implementing the PaintCellBackground event of your listbox to handle changing the row background colors.

Now you’ll need to implement the PaintCellText event to handle the font colors.

If you just want to change the text color for the whole cell, you don’t even need to draw the text yourself. In the PaintCellText event, create an if or select block to narrow down the change to just the cells you want. Set g.Forecolor to a color and Return False, the framework will then draw the text in your chosen color in that cell.

---

<div class="post-metadata">

**Author:** ![Volbragt\_Etienne](https://forum.xojo.com/user_avatar/forum.xojo.com/volbragt_etienne/32/6530_2.png) [@Volbragt\_Etienne](https://forum.xojo.com/u/Volbragt_Etienne)\
**Post date:** [September 23, 2026, 6:48pm UTC](https://forum.xojo.com/t/desktoplistbox-color-text-and-background/88925/3 "2026-09-23T18:48:16Z")

</div>

Thanks Christian for the reply.  
I will take a look at it.
