How to customize Main Menu?

goodmorningsky

Centurion
Joined
Aug 18, 2003
Messages
172
Hello,

I created custom MenuItem class named SkyMenuItem : MenuItem.

I want MainMenu to use my custom SkyMenuItem class when I design mainmenus.

I think I have to customize MainMenu class too.
But, I don't know how to do it to force it to use Custom MainMenu in design time!

Any idea or reply will help!!

Thank you all.
 
I don't know how to add a derived menu item to menus via the Windows Forms Designer (maybe someone knows how to do this with a macro or addin, or by inheriting or providing different designer classes). What you can do (this is what I do) is add the menu items, and do a search and replace to swap them out with your menu item class.

Generally, you do not need to inherit the MainMenu class. You might want to, though. For example, I created an owner drawn menu class with the nifty graphics and side bar and gradients and what not, but didn't want to have to set all the different properties of all the different menu items, so I overrode the MainMenu class and added the color/sidebar/etc. properties to that, rather than the MenuItem class.
 
Back
Top