Search code examples
c#treeview

TreeView control in C#, select() and focus


When I select a Node in the TreeView, it highlights and I show data based on that Node. When I select another Control (the TreeView loses focus) it is no longer highlighted. How do I keep it highlighted after losing focus?
While doing a search I cant tell which node is selected since I must keep the focus on the textbox (so the user can type more text).


Solution

  • You have to set the HideSelection property to false - so you'll see the selection, altough the TreeView control lost focus