I know this is an old question, but I had problems finding a decent answer, so we go. An index or key is not always available. When creating, I put the full path of the node in node.tag. When double-clicking, I return the tag value, and then I look at the treeview node collection for the tag. Too much? ineffective? maybe, but his work likes charm every time, and I can use my own identifiers in the tag based on the purpose of the tree structure. Search Code:
Sub MyTreeview_FindNode(strKey As String)
Dim myNode As Node
For Each myNode In Me.Treeview.Nodes
If myNode.Tag = strKey Then
myNode.Selected = True
myNode.EnsureVisible
End If
Next
End Sub
source
share