How do I use TreeView?
Add nodes and sub-nodes and sub-sub-nodes etc. in Run time and in Design time?
This is pretty hard.
ThanX in advance.
Printable View
How do I use TreeView?
Add nodes and sub-nodes and sub-sub-nodes etc. in Run time and in Design time?
This is pretty hard.
ThanX in advance.
To add a top-level node:
Where ImageListIndex and ImageListIndex_Selected are the indices of images in an ImageList control, that is bound at design time using the "Custom" property.Code:Dim nd as Node
Set nd = tv.Nodes.Add(, , "Key", "Text", ImageListIndex, ImageListIndex_Selected)
To add subnodes, simply set them as child:
Hope this helps.Code:Dim ndx as Node
Set ndx = tv.Nodes.Add(nd, tvwChild, "ChildKey", "My child's Text", img_idx, smallimg_idx)