关于重新排列菜单栏上的菜单项 (VBA/ActiveX)
要重新排列菜单栏上的菜单,请插入和删除菜单,直到达到所需的配置。 将第一个菜单移到菜单栏的末尾本示例删除菜单栏上的第一个菜单,并将其作为菜单栏上的最后一个菜单插入。 Sub Ch6_MoveMenu() ' Define a variable to hold the menu to be moved Dim moveMenu As AcadPopupMenu Dim MyMenuBar As AcadMenuBar Set MyMenuBar = ThisDrawing.Application.menuBar ' Set moveMenu equal to the first menu displayed ' on the menu bar Set moveMenu = MyMenuBar.Item(0) ' Remove the first menu from the menu bar MyMenuBar.Item(0).RemoveFromMenuBar ' Add the menu back into the menu bar ' in the last position on the bar moveMenu.InsertInMenuBar (MyMenuBar.count) End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-19 06:40
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.