Rearrange Menu Items on the Menu Bar

AutoCAD ActiveX

 
Rearrange Menu Items on the Menu Bar
 
 
 

To rearrange menus on the menu bar, insert and remove menus until the desired configuration is achieved.

Move the first menu to the end of the menu bar

This example removes the first menu on the menu bar and inserts it as the last menu on the menu bar.

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