I am getting strange results on my treeview.
The reason I am having problems is that when I click on the + (expand) of a node, it seems to have the tvwTree.SelectedItem set to the previous item, rather than the item I am expanding.
On investigation this seems to be due to the events that are triggered.
When I click the + (expand) button on a node, it seems to either trigger the Expand Event or the Click Event.
If I put Msgbox "Expand" at the start of the Expand event and Msgbox "Click" at the start of the Click event, then clicking expand causes only the "Expand" message to be shown.
If I remove the Msgbox "Expand", clicking expand causes the "Click" message to be shown - don't know if the expand event case triggered first though.
I suspect this is something to do with timing and the Msgbox obviously affects that.
Can't find out which event should be triggered when pressing + (expand) and why it does not have the correct selected item.