I am using the following code to get the node a user clicks on. I also want to get the parent node of the node the user clicked on.
Private Sub UltraTree1_MouseUp(ByVal sender As Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles ultratree1.MouseUp Dim tree As UltraTree tree = DirectCast(sender, UltraTree) Dim aNode As UltraTreeNode Dim parentNode As UltraTreeNode '// Parent node variable of node users clicked
aNode = tree.GetNodeFromPoint(e.X, e.Y) '// Establish node users clicked
If (Not aNode Is Nothing) Then Me.UltraTextEditor1.Text = aNode.Text '// dump anode variable to editor
End If
'// Now that we know the node the user clicked on. '// Need code to get the parent node of the node the user clicked.
Me.UltraTextEditor2.Text = parentNode.text '// Display parentNode variable in editor 'End If End Sub
Use aNode.Parent.
Thank you. I swear I tried that lastnight... see what happens when a person codes at 2am.