TreeView selection highlighting

  • Thread starter Thread starter Artem Kliatchkine
  • Start date Start date
A

Artem Kliatchkine

Hi All,

When TreeView control loses focus it's selected node higlighting changes
it's colog, in my case to pale gray. This is the standard behaviour.
But I would like to keep the higlighting unchanged. With a huge number
of nodes in the tree it is unconvenient to look for the node selected
when scrolling the tree.

Is it posiible to do it whether using TreeView properties or via
Win32 API?

Thanks,
Artem
 
Hello,

Artem Kliatchkine said:
When TreeView control loses focus it's selected node
higlighting changes it's colog, in my case to pale gray.
This is the standard behaviour. But I would like to keep
the higlighting unchanged.

Have a look at the TreeView's 'HideSelection' property.
 
Herfried K. Wagner [MVP] wrote:

No, it's not what I need. When HideSelection is set to true
and TreeView loses a focus the selection is hidden completely. In
my case it is set to false and the selection remains, but changes it's
color.
Color depends on a desktop scheme used, in my case it changes it's color
from bright blue to pale gray. It's just like windows explorer window
behaves, I suppose it's a standard behaviour. But I would like TreeView
to keep the same selection color no matter if it is focused or not.
 
It has to be done through CustomDrawing. If you use the CustomDraw framework
provided by the native TreeControl of which the .NET TreeView control is
just a wrapper then you can pretty much choose any color you want to paint
the node. Of course, the MSDN documentation has a truck load of
documentation on CustomDrawing the controls in the Common Control Library.


Carlos H. Perez
SharpLibrary a Graphical User Interface Library for the .NET Framework
http://www.sharplibrary.com
 
Back
Top