-
I'm trying to populate a treeview with the following method but it doesn't show the child node.. It shows the line going to where the child should be but no text appears.. What the heck am I doing wrong?
Code:
'-- initialize treeview
TreeView1.Nodes.Add , , "Test", "Test"
TreeView1.Nodes.Add "Test", tvwChild, "Test Child"
Any help would be appreciated..
Dan
-
Hi,
You are not seeing any text because didnt ask it to show any text. for the second node you forgot to specify any text.
Here is the modified code
Code:
Private Sub Form_Load()
With TreeView1
.Style = tvwTreelinesPlusMinusText
.Nodes.Add , , "TheKey", "The Text"
.Nodes.Add "TheKey", tvwChild, "TheKey2", "More Text"
For i = 1 To .Nodes.Count 'expand the whole tree
.Nodes(i).Selected = True
Next
End With
End Sub
Hope this helps
Danial