how to recursively view all child nodes in a treeview
Hi,
I'm trying to recursively go through all of the child nodes in a tree view upon clicking a button but I'm stuck. Currently, the code below only works for the top nodes in my treeview but I want it to go through each of these nodes' children, and their children and so on.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim child As TreeNode
Dim fullpath As String
For Each child In TreeView1.Nodes
fullpath = child.FullPath
Next
End Sub
If anyone can suggest a solution, or where I'm going wrong I'd be grateful.
Thanks,
Karl