[RESOLVED] Treeview - How to get list of child nodes for a node
Hi,
I think this is a pretty easy question, but I can't seem to find the answer in my search.
Let's say I have a treeview called treeview1. It's got three main nodes: BigNode1, BigNode2, and BigNode3. Each has some child nodes, like this:
Code:
BigNode1
LittleNode1
LittleNode2
LittleNode3
BigNode2
LittleNode4
LittleNode5
LittleNode6
BigNode3
LittleNode7
LittleNode8
LittleNode9
How do I get a list of the child nodes for one of the big nodes?
Thanks in advance.
-Bret
Re: Treeview - How to get list of child nodes for a node
Nevermind. I found it. Here's what I used:
Code:
Private Sub TreeView1_NodeCheck(ByVal Node As MSComctlLib.Node)
CheckUncheckNodes Node, Node.Checked
End Sub
Private Sub CheckUncheckNodes(ByRef MyParentNode As Node, ByVal bChecked As Boolean)
Dim MyNode As Node
Set MyNode = MyParentNode.Child
Do While Not MyNode Is Nothing
MyNode.Checked = bChecked
CheckUncheckNodes MyNode, bChecked
Set MyNode = MyNode.Next
Loop
End Sub