奇了怪了 这个代码用了N多次了 怎么会出现错误?
Syscmd.Project.OpenUserMenu()
For Each rb As RibbonMenu.Tab In RibbonTabs
rb.Visible = False
Next
Dim dt As DataTable = DataTables("功能导航")
Dim Arys As List(Of String())
Arys = dt.GetValues("功能组","","序号")
With ConfigBar
.Items.Clear
For Each Ary As String() In Arys
Dim m As New RibbonMenu.MenuButton(Ary(0))
msgbox(2)
m.Text = Ary(0)
' m.SmallImage = GetImage(Ary(1))
m.ArrowVisible = False
.Items.Add(m)
msgbox(1)
Dim drs As List(Of DataRow)
drs = dt.Select("[功能组] = '" & Ary(0) & "'","序号")
If drs.Count > 0 Then
For Each dr As DataRow In drs
Select Case dr("菜单控件类型")
Case "按钮"
Dim b As New RibbonMenu.Button(dr("模块名称"))
b.Text = dr("模块名称")
' b.SmallImage= GetImage(dr("模块图标"))
m.Items.Add(b)
End Select
Next
End If
Next
End With
我用其他的项目测试可以成功呀!
此主题相关图片如下:tt截图未命名.jpg
[此贴子已经被作者于2014-7-21 8:02:16编辑过]