I see only two solutions, the first is easy and works if the trees have same number of nodes and the second tree is expanded. Using NodeMouseClick event and GetNodeAt method you can select the node in other tree that is at same location as the one clicked in first tree:....root(0)
........child(0)
............child(0)
............child(1) <--- this?
............child(2)
........child(1) <--- this?
............child(0)
............child(1) <--- this?
....root(1) <--- this?
........child0
Private Sub TreeView1_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) _
Handles TreeView1.NodeMouseClick
Me.TreeView2.SelectedNode = Me.TreeView2.GetNodeAt(e.Location)
End Sub
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) _
Handles TreeView1.AfterSelect
Dim node As TreeNode = e.Node
'get the index path
Dim idx As New Stack(Of Integer)
While node IsNot Nothing
idx.Push(node.Index)
node = node.Parent
End While
'walk the index path
node = Me.TreeView2.Nodes(idx.Pop)
For i As Integer = 1 To idx.Count
If node.Nodes.Count > idx.Peek Then
node = node.Nodes(idx.Pop)
Else
Exit Sub
End If
Next
Me.TreeView2.SelectedNode = node
End Sub