I have a TreeView control in a Winforms app, and basically the objective is to display a form that contains a TreeView control, and I want to display the form with a node opened (easy – EnsureVisible) and selected.
The problem that I’m running into is that when I set the TreeView control’s SelectedNode property, the node isn’t highlighted and the AfterSelect event isn’t firing as I would expect it to. The AfterSelect thing is easy to code around, but the lack of highlighting is annoying.
Is it because the TreeView doesn’t have focus? Does setting the TreeView’s HideSelection property to False change the behavior you’re seeing?