How do I exit from the recursive loop from the code below. I would like to notify the end-user to select a checkbox in a msgBox before I exit the loop. Thanks.
Private Sub PrintRecursive(ByVal n As TreeNode)
System.Diagnostics.Debug.WriteLine(n.Text)
If (n.Checked = True) Then
MessageBox.Show(n.Checked)
Else
If (n.Checked = False) Then
MessageBox.Show("Check a bex")
End If
End If
' MessageBox.Show(n.Checked)
Dim aNode As TreeNode
For Each aNode In n.Nodes
PrintRecursive(aNode)
Next
End Sub
' Call the procedure using the top nodes of the treeview.
Private Sub CallRecursive(ByVal aTreeView As TreeView)
Dim n As TreeNode
For Each n In aTreeView.Nodes
PrintRecursive(n)
Next
End Sub