Good day..
Can everyone help me pls..
i have created a code to create nodes in treeview and i am done with this. my problem is how can i view children's text on the treeview as well as the image when i click the parent?
here is my code.
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
For i = 1 To Node.Children
' in this area i want to view child's text using msgbox as well
'as the image
MsgBox (Node.child.text) '
Next i
End Sub
Private Sub Form_Load()
create_node
end sub
sub create_node()
Set TreeView1.ImageList = ImageList1 'cl & op images inserted in imagelist
Dim nodx As Node
Set nodx = TreeView1.Nodes.Add(, , "root", "Root", "rt")
nodx.Expanded = True
Set nodx = TreeView1.Nodes.Add("root", tvwChild, "1st","first", "cl")
nodx.ExpandedImage = "op"
Set nodx = TreeView1.Nodes.Add("1st", tvwChild, , "node1", "cl")
nodx.SelectedImage = "op"
Set nodx = TreeView1.Nodes.Add("1st", tvwChild, , "node2", "cl")
nodx.SelectedImage = "op"
Set nodx = TreeView1.Nodes.Add("1st", tvwChild, , "node3", "cl")
nodx.SelectedImage = "op"
Set nodx = TreeView1.Nodes.Add("root", tvwChild, "2nd", "Second", "cl")
nodx.ExpandedImage = "op"
Set nodx = TreeView1.Nodes.Add("2nd", tvwChild, , "node1", "cl")
nodx.SelectedImage = "op"
Set nodx = TreeView1.Nodes.Add("2nd", tvwChild, , "node2", "cl")
nodx.SelectedImage = "op"
Set nodx = TreeView1.Nodes.Add("2nd", tvwChild, , "node3", "cl")
nodx.SelectedImage = "op"
end sub