Listbox color

is it possible to customize a listbox color, e g backgroundcolor = black, grids and text = white ?

there are some events to paint background and foreground
of header and cells.

have a series of articles about the ListBox.

The language Reference have also code to do what you ask:

Code from the Xojo 2015r1 LR:

This code can be used to do alternate row highlighting:
If row Mod 2 = 0 Then
  g.ForeColor = &cf3f6fA
  g.FillRect(0, 0, g.Width, g.Height)
End If

This example paints the cell background red if the celltag contains the string "Red"
If Me.CellTag(row, column ) = "Red" Then
  g.ForeColor = RGB(255, 0, 0)
  g.FillRect(0, 0, g.Width, g.Height)
End If

In Xojo 2015r1 (and many if not all others), if you choose “Use built-in documentation”, you will get the documentation for the IDE version you actually run, instead of using the last one from the internet.

The window is the Preferences window.

Thank you Emile,
Use built-in …

I do not found any property about listbox color back and fore(text) .
I thought that is same as Textfield or TextArea behavior …

With Listbox you have events like CellBackgroundPaint and CellTextPaint where you can change the properties of the Graphics object or do entirely your own drawing.

And only oe color is used (ForeColor) the color to use to draw whatever you want (border color or fill color).
Check g as Graphics for more details.

Here’s for ListBox:


Thank you !