Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

TreeView - traverse the tree


Public Sub TraverseTree(objNode As Node, Level)
'recursive
Dim objSiblingNode As Node
Set objSiblingNode = objNode
Do
    'optional - txtResults = txtResults & Level & " .. " & objSiblingNode.Text & Chr(13) & Chr(10)
    If Not objSiblingNode.Child Is Nothing Then Call TraverseTree(objSiblingNode.Child, Level + 1)
    Set objSiblingNode = objSiblingNode.Next
Loop While Not objSiblingNode Is Nothing
End Sub