Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Mar 5, 2001



Application Security Testing: An Integral Part of DevOps

Expanding All the Subnodes For a Node in a TreeView

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
Ahmad Khalil
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date