The following recursive function allows users to do an expand all via a
popup menu:
Public Sub ExpandAll(ByVal aNode As Node)
Dim l_Counter As Long
Dim l_Children As Long
Dim temp_Node As Node
l_Children = aNode.Children
If l_Children Then
aNode.Expanded = True
Set temp_Node = aNode.Child
For l_Counter = 0 To l_Children - 1
ExpandAll temp_Node
Set temp_Node = temp_Node.Next
Next l_Counter
End If
End Sub
Private Sub mnuExpand_Click()
' Hide the TreeView and things will go much faster
tvwTree.Visible = False
ExpandAll tvwTree.SelectedItem
tvwTree.Visible = True
End Sub