我也奉新一个计算 多层目录树节点数目的树显示算法
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.Nodes.Count > 0 Then
If nd.Nodes.Count = nd.AllNodes.count Then
nd.text = nd.text & "(" & nd.nodes.count &")"
Else
Dim Endjd As Integer = 0
For Each nd1 As winform.treenode In nd.allnodes
If nd1.nodes.count = 0 Then
endjd = endjd +1
End If
Next
nd.text = nd.text & "(" & nd.nodes.count &"|" & Endjd &")"
End If
End If
Next
显示效果、
此主题相关图片如下:2012-10-13_210918.jpg
[此贴子已经被作者于2012-10-13 21:09:46编辑过]