-
I have a treeview with several parent and child views, but only those two layers. I want to grab the text from the Parent when I click on the child, is there a way to do this.
In otherwords if I have this:
Fred
|
|----Address
|----Phone Number
And i click on address, I want to set a string variable to the Text of the parent, in this case Fred. Thanks in advance
Ed Farias
-
Here you go:
Code:
Private Sub myTree_NodeClick(ByVal Node As MSComctlLib.Node)
Dim myText
If Node.Children > 0 Then Exit Sub
myText = Node.Parent.Text
MsgBox myText
End Sub