.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Urgent:- How to create Submenu

2 REPLIES 2
Reply
Message 1 of 3
aslam
230 Views, 2 Replies

Urgent:- How to create Submenu

Dear All,
Plz any body tell me how to create a submenu by using PopMenu class. I could not found any good tutorial to learn how to create menus and submenu. Some how i m able to create menu but could not found how to add submenu in it. I aslo want to set events on them and enable and disable the items.
Plz Urgent. thanks....
2 REPLIES 2
Message 2 of 3
pavlos.katsonis
in reply to: aslam

Here dimensionMenu points to the AcadPopupMenu representing the Dimension Menu.
The code adds a submenu (camSubMenu) and several menu entries into it. As for the events, you'll have to play with the items returned by the AddMenuItem methods.

[code]
AcadPopupMenu camSubMenu = dimensionMenu.AddSubMenu(dimensionMenu.Count, "CAM Dimensions");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Square", "SQUAREDIM ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Sphere Radius", "SPHERERADIUS ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Sphere Diameter", "SPHEREDIAMETER ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Key", "KEYDIM ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Leader", "LEADERDIM ");
[/code]
Message 3 of 3
aslam
in reply to: aslam

Hi pavlos,
Very thanks for help. It is working. Now two more question plz help.

1. How to assign shortcut key to menuitems. like CTRL+SHIFT+T.
2. How to set image to menu item.
3. I tried to give a name like "Ho&spital". Here 's' should become the "Hot Key". But it did not work. Plz help.
Thanks...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost