.NET

Reply
Valued Contributor
aslam
Posts: 86
Registered: ‎07-22-2006
Message 1 of 3 (92 Views)

Urgent:- How to create Submenu

92 Views, 2 Replies
11-30-2006 02:26 AM
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....
Valued Contributor
pavlos.katsonis
Posts: 67
Registered: ‎09-12-2006
Message 2 of 3 (92 Views)

Re: Urgent:- How to create Submenu

11-30-2006 04:13 AM 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]
Valued Contributor
aslam
Posts: 86
Registered: ‎07-22-2006
Message 3 of 3 (92 Views)

Re: Urgent:- How to create Submenu

12-01-2006 01:13 AM 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...
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!