Foxtable(狐表)用户栏目专家坐堂 → 求助个问题,关于系统菜单目录循环


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

主题:求助个问题,关于系统菜单目录循环

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2013/9/29 7:26:00 [显示全部帖子]

下面是做权限表的时候,用到的,楼主可以参考:

 

DataTables("权限表").DataRows.Clear()

'''--------------功能区菜单
For Each rtb As RibbonMenu.Tab In RibbonTabs
    For Each grp As RibbonMenu.Group In rtb.Groups
        For Each itm As RibbonMenu.RibbonItem In grp.Items
            Dim dr As DataRow = DataTables("权限表").AddNew()
            dr("表窗口功能区") = rtb.Name
            dr("列控件功能组") = grp.Name
            dr("菜单按钮") = itm.Name
            If Typeof itm Is RibbonMenu.ToolBar OrElse Typeof itm Is RibbonMenu.ComboBox _
                OrElse Typeof itm Is RibbonMenu.FontComboBox OrElse Typeof itm Is RibbonMenu.MenuButton _
                OrElse Typeof itm Is RibbonMenu.SplitButton OrElse Typeof itm Is RibbonMenu.ToggleGroup Then
                For Each itm1 As RibbonMenu.RibbonItem In RibbonTabs(rtb.Name)(grp.Name)(itm.Name).Items
                    Dim dr1 As DataRow = DataTables("权限表").AddNew()
                    dr1("表窗口功能区") = rtb.Name
                    dr1("列控件功能组") = grp.Name
                    dr1("菜单按钮") = itm.Name
                    dr1("标准按钮") = itm1.Name
                    If Typeof itm1 Is RibbonMenu.ToolBar OrElse Typeof itm1 Is RibbonMenu.ComboBox _
                        OrElse Typeof itm1 Is RibbonMenu.FontComboBox OrElse Typeof itm1 Is RibbonMenu.MenuButton _
                        OrElse Typeof itm1 Is RibbonMenu.SplitButton OrElse Typeof itm1 Is RibbonMenu.ToggleGroup Then
                        For Each itm2 As RibbonMenu.RibbonItem In RibbonTabs(rtb.Name)(grp.Name)(itm.Name)(itm1.Name).Items
                            Dim dr2 As DataRow = DataTables("权限表").AddNew()
                            dr2("表窗口功能区") = rtb.Name
                            dr2("列控件功能组") = grp.Name
                            dr2("菜单按钮") = itm.Name
                            dr2("标准按钮") = itm1.Name
                            dr2("末级按钮") = itm2.Name
                        Next
                    End If
                Next
            End If
        Next
    Next
Next

'''----------------程序菜单左
For Each itm As RibbonMenu.RibbonItem In ApplicationMenu.LeftItems
    Dim dr As DataRow = DataTables("权限表").AddNew()
    dr("表窗口功能区") = "ApplicationMenu"
    dr("列控件功能组") = "LeftItems"
    dr("菜单按钮") = itm.Name
Next

'''----------------程序菜单右

For Each itm As RibbonMenu.RibbonItem In ApplicationMenu.RightItems
    Dim dr As DataRow = DataTables("权限表").AddNew()
    dr("表窗口功能区") = "ApplicationMenu"
    dr("列控件功能组") = "RightItems"
    dr("菜单按钮") = itm.Name
Next

'''----------------程序菜单底

For Each itm As RibbonMenu.RibbonItem In ApplicationMenu.BottomItems
    Dim dr As DataRow = DataTables("权限表").AddNew()
    dr("表窗口功能区") = "ApplicationMenu"
    dr("列控件功能组") = "BottomItems"
    dr("菜单按钮") = itm.Name
Next

'''----------------快速访问栏

For Each itm As RibbonMenu.RibbonItem In QAT.Items
    Dim dr As DataRow = DataTables("权限表").AddNew()
    dr("表窗口功能区") = "快速访问栏"
    dr("列控件功能组") = "快速访问栏"
    dr("菜单按钮") = itm.Name
Next

'''----------------配置栏

For Each itm As RibbonMenu.RibbonItem In ConfigBar.Items
    Dim dr As DataRow = DataTables("权限表").AddNew()
    dr("表窗口功能区") = "配置栏"
    dr("列控件功能组") = "配置栏"
    dr("菜单按钮") = itm.Name
Next

'''----------------快捷菜单
For Each conmenu As RibbonMenu.ContextMenu In ContextMenus
    For Each cmd As RibbonMenu.ContextCommand In conmenu.Items
        Dim dr As DataRow = DataTables("权限表").AddNew()
        dr("表窗口功能区") = "快捷菜单"
        dr("列控件功能组") = conmenu.Name
        dr("菜单按钮") = cmd.Name
    Next
Next


 回到顶部