Highlight selection even when tree is not focused
-
29-09-2019 - |
Question
I use simultaneously several TVirtualStringTree on the same form.
If a tree has a selected node, but the focus is currently on another tree, the selection is highlighted with a pale gray color.
Is there a simple way to have the selection of an unfocused TVirtualStringTree highlighted with the usual selction color (blue on my computer) ?
Thanks
Solution
While setting the colours will work, the "correct" method is enabling TreeOptions
--> PaintOptions
--> toPopupMode
toPopupMode // Paint tree as would it always have the focus (useful for tree combo boxes etc.)
OTHER TIPS
Okay, I found it : TVirtualStringTree has a "Color" property, with configurable subcolors, such as "UnfocusedSelctionColor" ...
Thanks, StackOverflow, for taking the glue out of my eyes :-)
[Edit] This was a first way I found to change the color of an unfocused selection, which workd, but glob's answer is the best way to do this.