Thanks. I have already done that, but do not know how to tell the inherited
control from MainMenu to use my MenuItem instead of the one from
windows.forms.menuitem.
Regards,
Trevor Benedict
Maybe you can extend MenuItem and add your custom property to subclass
that inherits MenuItem, such as ,Tag.
Now , you can add your subclass to Mainmenu.MenuItems container. Hope
it works.
Sincerely,
simida
Trevor Benedict R ??:
> What I am trying to do is to store some sort of a Reference to the Menu in
> the database and then based on permission I can either Enable or disable
[quoted text clipped - 6 lines]
>
> Trevor Benedict
Mini-Tools Timm - 07 Aug 2006 14:55 GMT
> Thanks. I have already done that, but do not know how to tell the inherited
> control from MainMenu to use my MenuItem instead of the one from
> windows.forms.menuitem.
If you've defined your custom menu item as follows:
public class MyMenuItem : MenuItem { ... }
Then in your inherited control, you can do this:
void ProcessMenuItem( MenuItem item )
{
MyMenuItem myItem = item as MyMenuItem;
if (myItem != null)
{
// process item
}
}

Signature
Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com
Trevor Benedict R - 08 Aug 2006 04:29 GMT
Thanks Timm,
But what I am looking at it to add some Custom Properties to the MenuItem
Class, by Inheriting it. I then need a way to use this Custom Menu Item
Class to be used by the MainMenu Control while being used in the Design
Mode.
What I have done is to Inherit the MenuItem and I have changed the Designer
Generated Code to Change all references to System.Windows.Forms.MenuItem to
MyProject.MyMenuItem, we'll the downside is that I will leave behind a very
poor design for other developers who might take over this project.
I was wondering if I could somehow Inherit the MainMenu Class and then tell
it to use myMenuItem. Hope I was clear enough.
I've also tried a different approach by using IExtenderProvider, I'm still
working on it.
Regards,
Trevor Benedict R
>> Thanks. I have already done that, but do not know how to tell the
>> inherited
[quoted text clipped - 15 lines]
> }
> }