BigJue 发表于 2005-4-28 15:30:00

这个函数是windowAPI函数,你要声明一下的.在module里面加上这句话:                                                                                               Public Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long) As Long

galayan 发表于 2005-4-28 16:49:00

出来了


谢谢!!!!!!!!!!!

pmq 发表于 2011-6-29 10:02:16

Sub ShHiToolbars() '显示或隐藏工具栏
   'Dim Button As AcadToolbarItem
      Dim Toolbar0 As AcadToolbar
      Dim MenuGrout0 As AcadMenuGroup
      'Dim SmallButtonName As String
      'Dim LargeButtonName As String
      'Dim ButtonType As String
      Set MenuGrout0 = ThisDrawing.Application.MenuGroups.Item(0)
      Set Toolbar0 = MenuGrout0.Toolbars.Item("测量剖面计算")
      Toolbar0.Visible = Not Toolbar0.Visible = True
End Sub

pmq 发表于 2011-6-29 20:01:42

显示或隐藏CAD所有工具条
Dim MenuGrout0 As AcadMenuGroup
Set MenuGrout0 = ThisDrawing.Application.MenuGroups.Item(0)
For i = 0 To MenuGrout0.Toolbars.Count - 1
      MenuGrout0.Toolbars.Item(i).Visible = False  '隐藏
   'MenuGrout0.Toolbars.Item(i).Visible = True  '显示
Next i

aiiitang 发表于 2011-7-26 17:27:11

有没有办法只隐藏(或失效)菜单、工具栏中的某一项?

pmq 发表于 2011-7-29 21:35:05

    Dim curMenuGroup As AcadMenuGroup
    Set curMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)
    Dim curMenu As AcadPopupMenu
      Set curMenu = curMenuGroup.Menus.Item("计算标注(&J)")
      Set menuItem = curMenu.Item("ID_分层计算面积")
      menuItem.Enable = False
      Set menuItem = curMenu.Item("ID_方量计算")
      menuItem.Enable = False
页: 1 [2]
查看完整版本: VB下如何编程隐藏AutoCAD的菜单跟工具栏?