Foxtable(狐表)用户栏目专家坐堂 → 目录树


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

主题:目录树

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/11/15 23:05:00 [显示全部帖子]

Dim trv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1")
trv.nodes.Clear
Dim dt As DataTable = DataTables("授权")
For Each dr As DataRow In dt.Select("用户 is not null")
    For Each s As String In dr("用户").split(",")
        Dim nd As WinForm.TreeNode
        If trv.nodes.Contains(s) Then
            nd = trv.nodes(s)
        Else
            nd = trv.nodes.add(s)
        End If
        Dim cnd As WinForm.TreeNode
        If nd.Nodes.Contains(dr("分组")) = False Then
            cnd = nd.nodes.add(dr("分组"))
        End If
        If dr("权限") > "" Then
           
            If cnd.Nodes.Contains(dr("权限")) = False Then
                cnd.nodes.add(dr("权限"))
            End If
        End If
    Next
Next

 回到顶部