How do I right align header text in a desktoplistbox + change the text color?

I have a (sub classed) DeskTopListBox with 4 columns. Two columns contain numbers and right align. The header text of course follows the Left/Right align of the rows below the header.
I use a method with (simplified here):

MyListBox.ColumnAlignmentAt(3) = DesktopListBox.Alignments.Right MyListBox.ColumnAlignmentAt(4) = DesktopListBox.Alignments.Right

Now I want to give the header text a slightly different color. I didn’t find a convenient font.color property for the header, but found in this forum some PaintHeaderContent EventHandler code:

g.DrawingColor = MyColor
Var y As Double = (g.Height - g.TextHeight)/2 + g.FontAscent
g.DrawText(Me.HeaderAt(column),5,y, g.width -10, True)

It works, except for the right alignment in the header. It looks I have to change the x-value 5 to a bigger value for the right align columns, but how do I retrieve the width of the header text (like in the y-value)?

Off topic, but related: Why isn’t there a simple property for the text color and the alignment in Xojo? Yes, it is very flexible as it is now, but it comes at a “diffuculty-cost”.

Hmmm, I solved myself. Typing a question here in the forum always helps to clarify thing for me :smiley:
This code did it (for me) in the PaintHeaderContent EventHandler:

Var y As Double = (g.Height - g.TextHeight)/2 + g.FontAscent
Var x As Double

' Get the left position of the text. The columns 3 and 4 must right align.
If column < 2 Then
  x = 4
Else
  x = g.width - g.TextWidth(Me.HeaderAt(column)) - 6
End If

g.DrawText(Me.HeaderAt(column),x,y, g.width -10, True)