以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何获取目录树某个节点的最大层级数?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=76242)

--  作者:rjh4078
--  发布时间:2015/10/25 8:54:00
--  如何获取目录树某个节点的最大层级数?
如题


--  作者:lsy
--  发布时间:2015/10/25 9:41:00
--  
Dim tvw As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim cnt As Integer
For Each nd As WinForm.TreeNode In tvw.AllNodes
    If nd.FullName.Split("\\").Length > cnt Then
        cnt = nd.FullName.Split("\\").Length
    End If
Next
MessageBox.Show(cnt)