level 1
whbook
楼主
''传递参数,调用过程
Dim abc As String = TreeSelectNode(参数1代表从数据库中读取的节点Fullpath, TreeView1.Nodes)
''自已写的递归过程
Public Function TreeSelectNode(MyFullpath As String, cc As TreeNodeCollection) As String
For Each vnode As TreeNode In cc
If vnode.FullPath = (MyFullpath Then
MsgBox(vnode.FullPath) ''这里能看到已经获取了树节点的路径值
Return vnode.FullPath ''这句返回对不对呀?返回值老是Nothing,神马情况呢?
Exit Function
End If
TreeSelectNode(MyFullpath,vnode.Nodes)
Next
End Function
2013年12月24日 08点12分
1
Dim abc As String = TreeSelectNode(参数1代表从数据库中读取的节点Fullpath, TreeView1.Nodes)
''自已写的递归过程
Public Function TreeSelectNode(MyFullpath As String, cc As TreeNodeCollection) As String
For Each vnode As TreeNode In cc
If vnode.FullPath = (MyFullpath Then
MsgBox(vnode.FullPath) ''这里能看到已经获取了树节点的路径值
Return vnode.FullPath ''这句返回对不对呀?返回值老是Nothing,神马情况呢?
Exit Function
End If
TreeSelectNode(MyFullpath,vnode.Nodes)
Next
End Function