Toolbars and Menus

G

Guest

Hello Sir/Madam,
I am tring to create Menu and toolbar controls that looks like the one used in Office Xp. I have trird using the Menu class to create my own myMainMenu and MyMenuItem but in Ide after I put myMainMenu and try to create the subitems it creates MenuItem rather than myMenuItem how do i solve this problem. Also what would be the right way to achive my target create from scratch or use these base classes. If you could frovide any further information that I havent aksed you are most welcome. Also I am a VB.NET not c# so please keep that in mind when you reply.

Regards
Raj Singh Sisodia
 
M

Mick Doherty

The MenuDesigner is Private so you cannot derive from MainMenu and get it to
use your custom menuitems.
You have options though:

1. Code the Paint and MeasureItem Events for every MenuItem after setting
them to OwnerDraw.

2. Create your menu as usual and, once you've defined all the menuitems,
expand the 'Windows Form Designer generated code' region and do a search and
replace of 'System.Windows.Forms.MenuItem' with 'MyNameSpace.MyMenuItem'
(assuming that's the NameSpace and Name of your custom MenuItem)

3. Create a MenuExtender component to extend the properties of standard
MenuItems.

An Office Style Menu Class(Source Code)
http://dotnetrix.co.uk/menus.html

A MenuExtender(No Source, but you will find source for similar components
via Google)
http://dotnetrix.co.uk/controls.html --> MenuSkinner

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


Raj Singh Sisodia said:
Hello Sir/Madam,
I am tring to create Menu and toolbar controls that looks like the one
used in Office Xp. I have trird using the Menu class to create my own
myMainMenu and MyMenuItem but in Ide after I put myMainMenu and try to
create the subitems it creates MenuItem rather than myMenuItem how do i
solve this problem. Also what would be the right way to achive my target
create from scratch or use these base classes. If you could frovide any
further information that I havent aksed you are most welcome. Also I am a
VB.NET not c# so please keep that in mind when you reply.
 
G

Guest

Hello Mick,
Thanks for your reply, it really helped me but actually I am tring to make a control and I dont want to write any extra code to use it. I want it to be as simple as using the menus provided by >net ramework or the other 3rd party controls.
I think I will go by your advise to create an extender.
Thank you again for your help.

Best Regards
Raj Singh Sisodia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top