[ARX]如何用程序暂时隐藏ACAD的菜单和工具条?
如何用程序暂时隐藏ACAD的菜单和工具条?<BR>比如文件--》帮助;标准-对象捕获等 <P>ctrl+0</P>VB开发CAD
<p><font face="Verdana"><font face="Verdana">Public Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long) As Long</font></font></p><p><font face="Verdana"><font face="Verdana"><br/> </p></font></font>
<p><font face="Verdana">Private Sub HIdeMenus_Click() ''隐藏/显示CAD菜单<br/> On Error Resume Next<br/> If hMenu <> 0 Then Exit Sub<br/> <br/> If HIdeMenus.Checked = False Then<br/> cMenu = GetMenu(lHwnd)<br/> SetMenu lHwnd, 0<br/> HIdeMenus.Checked = True<br/> Else<br/> SetMenu lHwnd, cMenu<br/> HIdeMenus.Checked = False<br/> End If<br/>End Sub</font></p>
<p><font face="Verdana"><br/><font face="Verdana">Private Sub HideTool_Click() '隐藏/显示CAD工具栏<br/> On Error Resume Next<br/> Dim Menugroup As Object<br/> Dim Toolbar As Object<br/> Dim i As Integer<br/> Static CadTools() As Boolean<br/> If Hidetool.Checked = False Then<br/> For Each Menugroup In AcadApp.MenuGroups<br/> ReDim CadTools(1 To Menugroup.Toolbars.Count)<br/> For Each Toolbar In Menugroup.Toolbars<br/> i = i + 1<br/> CadTools(i) = Toolbar.Visible '添加工具栏状态<br/> Toolbar.Visible = False<br/> Next Toolbar<br/> Next Menugroup<br/> Hidetool.Checked = True<br/> Else<br/> For Each Menugroup In AcadApp.MenuGroups<br/> For Each Toolbar In Menugroup.Toolbars<br/> i = i + 1<br/> Toolbar.Visible = CadTools(i)<br/> Next Toolbar<br/> Next Menugroup<br/> Hidetool.Checked = False<br/> End If<br/>End Sub</font></p></font> 用COM!不过觉得实用性不大
页:
[1]