Dim dt As DataTable = DataTables("菜单结构表")
'把功能区的名称分别列入菜单表
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 = dt.addnew() '定义新加行
dr("类型") = "功能区"
dr("功能区") = rtb.name
dr("功能组") = grp.name
dr("菜单按钮") = itm.name
dr("菜单类型") = itm.Gettype.name
If Typeof itm Is RibbonMenu.DatePicker Then
'此处以下是label 属性
Dim it2 As RibbonMenu.DatePicker = itm
dr("菜单标题") = it2.label
Else If Typeof itm Is RibbonMenu.NumericBox Then
Dim it2 As RibbonMenu.NumericBox = itm
dr("菜单标题") = it2.label
Else If Typeof itm Is RibbonMenu.TextBox Then
Dim it2 As RibbonMenu.TextBox = itm
dr("菜单标题") = it2.label
Else If Typeof itm Is RibbonMenu.TimePicker Then
Dim it2 As RibbonMenu.TimePicker = itm
dr("菜单标题") = it2.label
Else If Typeof itm Is RibbonMenu.ComboBox Then
Dim it2 As RibbonMenu.ComboBox = itm
dr("菜单标题") = it2.label
Else If Typeof itm Is RibbonMenu.FontComboBox Then
Dim it2 As RibbonMenu.FontComboBox = itm
dr("菜单标题") = it2.Label
'此处一下是text
Else If Typeof itm Is RibbonMenu.Button Then
Dim it2 As RibbonMenu.Button = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.menuButton Then
Dim it2 As RibbonMenu.menuButton = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.splitButton Then
Dim it2 As RibbonMenu.splitButton = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.toggleButton Then
Dim it2 As RibbonMenu.toggleButton = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.label Then
Dim it2 As RibbonMenu.label = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.checkbox Then
Dim it2 As RibbonMenu.checkbox = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.separator Then
Dim it2 As RibbonMenu.separator = itm
dr("菜单标题") = it2.Text
Else If Typeof itm Is RibbonMenu.Colorpicker Then
Dim it2 As RibbonMenu.Colorpicker = itm
dr("菜单标题") = it2.text
Else If Typeof itm Is RibbonMenu.FontComboBox Then
Dim it2 As RibbonMenu.FontComboBox = itm
dr("菜单标题") = it2.Text
Else If Typeof itm Is RibbonMenu.ProgressBar Then
Dim it2 As RibbonMenu.ProgressBar = itm
dr("菜单标题") = it2.Text
Else If Typeof itm Is RibbonMenu.TrackBar Then
Dim it2 As RibbonMenu.TrackBar = itm
dr("菜单标题") = it2.Text
End If '
dr.save()
Next
Next
Next