老师:
窗口afterload执行以下代码的时候出现报错,未将对象引用设置到对象的实例。用户名的树形结构出不来,麻烦看一下。
Dim tr As WinForm.TreeView
Dim nd As WinForm.TreeNode
tr = e.Form.Controls("用户")
nd = Tr.Nodes.Add("所有用户","所有用户")
For Each u As UserInfo In Users
If u.Type = UserTypeEnum.User Then
If tr.Nodes("所有用户").Nodes.Contains(u.Group) = False Then
tr.Nodes("所有用户").Nodes.Add(u.Group)
End If
tr.Nodes("所有用户").Nodes(u.Group).Nodes.Add(u.Name)
End If
Next
tr.ExpandAll