''' Dim ary() As String = e.Text.split(";") Dim trv As WinForm.TreeView = e.Form.controls("Treeview1") If trv Is Nothing Then Return trv.nodes.clear For Each str As String In ary Dim s() As String = str.split(",") If s.length <> 4 Then Continue For Dim n1 As WinForm.TreeNode = Nothing Dim n2 As WinForm.TreeNode = Nothing Dim n3 As WinForm.TreeNode = Nothing Dim n4 As WinForm.TreeNode = Nothing For Each nd1 As WinForm.TreeNode In trv.Nodes If nd1.name = s(0).trim Then n1 = nd1 For Each nd2 As WinForm.TreeNode In nd1.Nodes If nd2.name = s(1).trim Then n2 = nd2 For Each nd3 As WinForm.TreeNode In nd2.Nodes If nd3.name = s(2).trim Then n3 = nd3 End If Next End If Next End If Next If n1 Is Nothing Then n1 = trv.nodes.Add(s(0).trim) End If If n2 Is Nothing Then n2 = n1.nodes.Add(s(1).trim) End If If n3 Is Nothing Then n3 = n2.nodes.Add(s(2).trim, s(2).trim & "(" & s(3) & ")") End If Next
|