For Each a1 As RibbonMenu.Tab In RibbonTabs Dim count1 As Integer = 0 For Each a2 As RibbonMenu.group In a1.Groups Dim count2 As Integer = 0 For Each a3 As RibbonMenu.RibbonItem In a2.Items ' ToolBars 'If a3.name.Contains("退出")=True Or a3.name.Contains("标准按钮")=True Then Continue For If zc="" Then r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "'")
Else r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "' And " & zc) End If If r Is Nothing Then a3.Visible=False Else a3.Visible=True count2 += 1 End If Next If count2 = 0 Then a2.Visible = False Else a2.Visible=True count1 += 1 End If Next If count1 = 0 Then a1.Visible = False else a1.Visible=true End If Next