如何遍历树的所有节点
1个回答
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CallTreeView(Me.TreeView1)
End Sub
Private Sub ForTreeNode(ByVal TempNode As TreeNode)
MessageBox.Show(TempNode.FullPath)
Dim aNode As TreeNode
For Each aNode In TempNode.Nodes
ForTreeNode(aNode)
Next
End Sub
Private Sub CallTreeView(ByVal aTreeView As TreeView)
Dim TempNode As TreeNode
For Each TempNode In aTreeView.Nodes
ForTreeNode(TempNode)
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询