I have a form in which I have a treeview control. If the form loses focus and then regains focus, I want to ensure that the treeview is up-to-date and then reset focus back to the previous selected node.

However, in the OnGotFocus override I am having trouble knowing how to refrence the treeview.

I have tried the following in the OnGotFocus sub:

Dim mIndx as Integer

mIndx = me.treeview1.selectednode.index


Can anyone help me ?

Thanks a bunch !