2

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

2
  • If you do that, how would you be able to see which treeview actually has the focus? Commented Jun 23, 2010 at 7:41
  • In my case, I don't care so much : tv2 displays info about tv1's selection. And you still have the focus rect to tell you that.
    – LeGEC
    Commented Jun 23, 2010 at 7:46

2 Answers 2

12

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.)
0
2

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.