弄了一个动态根据 表生成功能组与导航栏的,但导航栏出问题,在功能组中,能正常隐藏未勾选的功能区,但在导航栏中,却不正确 的全部显示了,哪位大师帮我看看,代码哪儿出错了?
此主题相关图片如下:1.jpg
Dim dt As DataTable = DataTables("zac00000")
For Each tbs As String() In dt.GetUniqueValues("","funcid","funcname")
Dim t As New RibbonMenu.Tab(tbs(0))
t.Text = tbs(1) '设置功能区的标题
RibbonTabs.Add(t)
For Each gps As String() In dt.GetUniqueValues("funcid = '"& t.name &"'","fungid","fungname")
Dim g As new RibbonMenu.Group(gps(0))
g.Text = gps(1) '设置功能组的标题
t.Groups.Add(g)
For Each itms As String() In dt.GetUniqueValues("funcid = '"& t.name &"' and fungid = '"& g.name &"' and ismenu = true","funbid","funbname","funicon","code")
Dim b As New RibbonMenu.Button(itms(0))
b.Text = itms(1) '设置功能按钮的标题
b.LargeImage = GetImage(itms(2))
b.ToolTip = itms(3) '设置功能组按钮的提示
g.Items.Add(b)
Next
g.Visible = (g.Items.Count > 0)
Next
t.Visible = (t.Groups(0).visible = True)