Foxtable(狐表)用户栏目专家坐堂 → 用户数超500代码出错,请老师帮忙看看!


  共有2633人关注过本帖树形打印复制链接

主题:用户数超500代码出错,请老师帮忙看看!

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106816 积分:543281 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/10/13 14:17:00 [显示全部帖子]

我测试没有问题,和用户数没有关系。应该是其中有用户的Group是空的。

Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nn As WinForm.TreeNode = trv2.Nodes.Add("未分组")
For Each u As UserInfo In Users
    If u.Type = UserTypeEnum.User Then
        If u.Group > "" Then
            If trv2.Nodes.Contains(u.Group) = False Then
                trv2.Nodes.Add(u.Group)
            End If
            trv2.Nodes(u.Group).Nodes.Add(u.Name)
        Else
            nn.Nodes.Add(u.Name)
        End If
    End If
Next

 回到顶部