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

How to create a menu with sub menu with image

1 REPLY 1
Reply
Message 1 of 2
kelcyo
531 Views, 1 Reply

How to create a menu with sub menu with image

Hi,

 

Someone can give an example of how to create a menu and include a sub menu with image?

I wonder in NET, because using COM have seen some examples more cannot put the image on the MenuItem.

Grateful.

1 REPLY 1
Message 2 of 2
chiefbraincloud
in reply to: kelcyo

I was successful at putting an icon on a submenu item on the contextmenu (right click), but I do not see how to do it if you are talking about the main Pulldown menubar.

 

On the context menu, it is simple.  There is an overload of the New Constructor for MenuItem that accepts an Icon parameter.  It did act a little wierd though.  I created an Icon and tested my code, and it failed saying the Icon had to be a 16x16 Icon, I had made mine 32x32.  Then I changed the Icon to 16x16 and it still  gave the error.  So I passed it a newly created icon like this:   

 New Drawing.Icon(My.Resources.Icon1, 16, 16)

and that worked.

In terms of creating the ContextMenuExtension in the first place, there is a post (actually mulitple posts) on Kean Walmsley's Blog.

http://through-the-interface.typepad.com/through_the_interface/2007/05/its_all_in_the_.html

Dave O.                                                                  Sig-Logos32.png

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