How do I use the TreeView control?
Add nodes and writing there code?
Printable View
How do I use the TreeView control?
Add nodes and writing there code?
Hi,
This is how I do it!
You can keep repeating this for as many sub-folders as you want. Just make sure that if you want something to be in a folder, that it's RootID is the same ID as the root that you want it to be under!Code:Dim TVX as Node
Dim tvNode as Nodes
Set tvNode = TreeView1.Nodes
'To add a root
Set TVX = tvNode.Add(, , "RootID", "RootText") 'Adds a root
'To add a child to the root
Set TVX = tvNode.Add("RootID", tvwChild, "ChildID","ChildName") 'Adds a child to root with corresponding rootID
Hope this helps
Shaun