CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

关于重新排列菜单栏上的菜单项 (VBA/ActiveX)

2023-1-4 22:32| 发布者: admin| 查看: 497| 评论: 0|来自: AutoCAD

摘要: 要重新排列菜单栏上的菜单,请插入和删除菜单,直到达到所需的配置。

要重新排列菜单栏上的菜单,请插入和删除菜单,直到达到所需的配置。

将第一个菜单移动到菜单栏的末尾

本示例删除菜单栏上的第一个菜单,并将其作为菜单栏上的最后一个菜单插入。

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 18:06

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部