The VirtualStringTree header has a 'Background' property but setting it to a different color does not change the color. I suspect the tree is rendered using Windows themes.
How can I set the color?
The VirtualStringTree header has a 'Background' property but setting it to a different color does not change the color. I suspect the tree is rendered using Windows themes.
How can I set the color?
You can use property
THeader.Background
but you'll have to excludetoThemeAware
fromTreeOptions.PaintOptions
. That would turn off themes, as TLama already said in his comment above.I recommend you to use the events
OnAdvancedHeaderDraw
andOnHeaderDrawQueryElements
.hoOwnerDraw
has to be included inHeader.Options
for them to take effect.In
OnHeaderDrawQueryElements
you setElements
to (at least)[hpeBackground]
and inOnAdvancedHeaderDraw
you do the custom drawing.See this example (source):