I have a TreeView control and when the user clicks on a node it highlights fine. When the focus moves away from the control that highlight disappears. So,
categoryTree.HideSelection = False
should fix it, right? No luck, highlight disappears as soon as control loses focus.
So, I decide to set my own background color on the Leave event:
categoryTree.SelectedNode.BackColor = Color.LightBlue
This does NOT change the node's Backcolor till the control receives the focus again! Huh?
So, I´m thinking maybe there is some system code that executes on the control after my Leave event or the Refresh just doesn´t execute. As a last attempt I put that same code in the next control which receives focus (not a solution just a test). The system still does not repaint the TreeView control with that node´s background color. I've never seen Windows not repaint after the Refresh().
I am striking out 3 for 3 on this feature. I´d try Drawmode = OwnerDrawText but since the control doesn't appear to refresh without the focus I am leery about doing all that extra work for nothing. I am new to using this control - am I just missing something simple?