Question Loading a treeview with dynamic information

VB.MAN

Member
Joined
Feb 8, 2009
Messages
9
Programming Experience
5-10
Hi,

I'm start using it. I can create new dynamic nodes at run time in the first depth level. But how do I create dynamic nodes when I have to create one depth level, and then new nodes in it, in two depth level?

Here is an exmaple. In the right side you will see a full hierarchy chart in which I'm trying to do in VB.NET treeview. You can see in the left side what I have till now in the left side. I don't know how to dynamically, in run time, create a deeper node level just after the second level.
hierarchy.JPG


My code:
TreeView1.Nodes.Add(New TreeNode("my text"))

Thanks!
 
Use TreeView1.Nodes.Add to add a root node, use node.Nodes.Add to add child nodes (where node is a TreeNode).
 
Back
Top