Private Sub HideTool_Click() '隐藏/显示CAD工具栏 On Error Resume Next Dim Menugroup As Object Dim Toolbar As Object Dim i As Integer Static CadTools() As Boolean i = 0 If Hidetool.Checked = False Then For Each Menugroup In AcadApp.MenuGroups ReDim CadTools(1 To Menugroup.Toolbars.Count) For Each Toolbar In Menugroup.Toolbars i = i + 1 CadTools(i) = Toolbar.Visible '添加工具栏状态 Toolbar.Visible = False Next Toolbar Next Menugroup Hidetool.Checked = True Else For Each Menugroup In AcadApp.MenuGroups For Each Toolbar In Menugroup.Toolbars i = i + 1 Toolbar.Visible = CadTools(i) Next Toolbar Next Menugroup Hidetool.Checked = False End If End Sub