Hierarchical listbox disclosure triangle question

I have changed the selected row text to black and the row background to a light color. When selected the disclosure triangle changes to white which makes it almost invisible on the light background. Is there a way to change the triangle to black. I only use Mac OS X I don’t know what happens on Windows.

Unfortunately not without doing a LOT of work…

  • Karen

This does not change the disclosure triangle to black, but one thing that you can consider is to change the background color, just in the area of the triangle, to some dark color.

Assuming that LIGHT_COLOR and DARK_COLOR are some color constants that have been assigned some light and some dark color respectively.

In the CellBackgroundPainting event

[code] If row = Me.ListIndex And column > 0 Then
g.ForeColor = LIGHT_COLOR
g.FillRect(0, 0, g.Width, g.Height)
Return True
End If

Dim darkStart As Integer = 20
Dim darkStop As Integer = 40

If row = Me.ListIndex And column = 0 Then
g.ForeColor = LIGHT_COLOR
g.FillRect(0, 0, darkStart, g.Height)
g.ForeColor = DARK_COLOR
g.FillRect(darkStart, 0, darkStop, g.Height)
g.ForeColor = LIGHT_COLOR
g.FillRect(darkStop, 0, g.Width, g.Height)
Return True
End If[/code]

Now you have to keep track of the degree of indentation so the dark background area corresponds to the location of the disclosure triangle. Depending on the degree of indentation, you adjust the darkStart and darkStop values.

Thanks for the suggestion Robert. It looks a little strange but I’m going with it.

I made a small change. I changed g.FillRect(darkStart to g.FillRoundRect(darkStart with values to get a round dark area.