-
May 2nd, 2006, 12:08 PM
#1
Thread Starter
Member
[02/03] Treeview question
Can child nodes have child nodes under them as well?
-Root
---|-Parent
------|-Child
---|-Parent
------|-Child
--------|-Child
Is this even possible?
-
May 2nd, 2006, 12:14 PM
#2
Re: [02/03] Treeview question
Short answer... Yes.
Is there anything about them that you're having trouble with? Keep in mind, the nodes can be both a parent and a child.
-
May 2nd, 2006, 12:15 PM
#3
Thread Starter
Member
Re: [02/03] Treeview question
Just trying to figure out how to add a child node to a child node... Would you know of any sample code that I could peek at?
-
May 2nd, 2006, 12:19 PM
#4
Re: [02/03] Treeview question
This will add a node to each of the root:
VB Code:
For Each obj As System.Windows.Forms.TreeNode In Me.TreeView1.Nodes
obj.Nodes.Add(obj.Text & "'s Child")
Next obj
Are you trying to find a specific one to add to?
-
May 2nd, 2006, 12:21 PM
#5
Re: [02/03] Treeview question
If you need to search through and find the one, you can revise the sample I posted here:
http://www.vbforums.com/showthread.php?t=394613
-
May 2nd, 2006, 12:38 PM
#6
Thread Starter
Member
Re: [02/03] Treeview question
Thanks for your reply... attached is an image of what I am trying to create...
-
May 2nd, 2006, 01:53 PM
#7
Re: [02/03] Treeview question
Originally Posted by infinisource
Thanks for your reply... attached is an image of what I am trying to create...
Hi,
Go to the Nodes Collection and add a root, name it and you created your first Root (parent).
Then click on that root and add a Child root, name it and you created a Child Root.
If you click on that Child Root and add a Child again then you created a Child root in your first Child root.
I hope it helps you,
sparrow1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|