关于为菜单项和工具栏项创建状态行帮助 (VBA/ActiveX)
状态行帮助消息是本机帮助支持的一个重要方面。这些是突出显示菜单或工具栏项时显示在状态行中的简单描述性消息。 所有菜单和工具栏项的状态行帮助都包含在该项的属性中。HelpString 首次创建菜单或工具栏项时,该属性为空。HelpString 向菜单项添加状态行帮助此示例创建一个名为“TestMenu”的新菜单,然后创建一个名为“Open”的菜单项。然后,为菜单项分配属性的状态行帮助。HelpString Sub Ch6_AddHelp() Dim currMenuGroup As AcadMenuGroup Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0) ' Create the new menu Dim newMenu As AcadPopupMenu Set newMenu = currMenuGroup.Menus.Add _ ("Te" + Chr(Asc("&")) + "stMenu") ' Add a menu item to the new menu Dim newMenuItem As AcadPopupMenuItem Dim openMacro As String ' Assign the macro the VBA equivalent of "ESC ESC _open " openMacro = Chr(3) + Chr(3) + "_open " ' Create the menu item Set newMenuItem = newMenu.AddMenuItem _ (newMenu.count + 1, Chr(Asc("&")) _ + "Open", openMacro) ' Add the status line help to the menu item newMenuItem.HelpString = "Opens an AutoCAD drawing file." ' Display the menu on the menu bar newMenu.InsertInMenuBar _ (ThisDrawing.Application.menuBar.count + 1) End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 22:19
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.