Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Sun Certified Web component Developer,

Microsoft Certified Solution Developer .NET,

Software Engineer

  • Leaders
Posted

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.

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...