Dim lsu As WinForm.TreeView = Forms("窗口9").Controls("TreeView1")
lsu.Nodes.Clear
Dim dict As new Dictionary(of String,WinForm.TreeNode )
For Each frm As WinForm.Form In Forms
If frm.Category > ""
If dict.ContainsKey(frm.Category) = False Then
Dim ar() As String = frm.Category.Split("\")
Dim n As WinForm.TreeNode
If lsu.Nodes.Contains(ar(0))
n = lsu.Nodes(ar(0))
Else
n = lsu.Nodes.Add(ar(0),ar(0))
End If
Dim i As Integer = 1
Do While i < ar.Length
If n.Nodes.Contains(ar(i))
n = n.Nodes(ar(i))
Else
n = n.Nodes.Add(ar(i),ar(i))
End If
i += 1
Loop
dict.Add(frm.Category,n)
End If
dict(frm.Category).Nodes.Add(frm.name)
Else
lsu.Nodes.Add(frm.name)
End If
Next