It sounds like I have a similar problem
I am working on an MDI template and I want to place code on the mainform to enable or disable menuitems.
The first problem is I must cope with menu items that do not exist while I am designing the template, they can be added later by another developer. I do not want to make the menu items public and open the existing items to tampering
The trigger to disable an item will originate from a child form which will not know about the menuitem objects and must pass a string to identify an item
I have code that works using the Text property but it won't allow for common item names. e.g. it thinks File/new and Window/new are the same thing
the second problem is processing the menu selections. If you want to process the menu click on the child form and cannot pass it an object, how do you identify the menu item? Remembering that the item in question was added to a derived form not the original template
----- Nicholas Paldino [.NET/C# MVP] wrote: ----
Rakesh
The designer accomplishes the name property by actually extending you
class and then hosting that in the property grid. The Name property is the
expose off that derived class. The Name property is really the name of th
variable, which you should know already. If you don't, then you will nee
to place the identifier of some sort on the MenuItem (by extending th
MenuItem class and attaching your information)
What are you trying to do
--
- Nicholas Paldino [.NET/C# MVP
-
mv*@spam.guard.caspershouse.co
"Rakesh" <an*******@discussions.microsoft.com> wrote in messag
news:0b****************************@phx.gbl..
Hi I am able to obtain a MenuItem object's Name property
design-time, but am not able to get the same @ run
time...why And since MenuItem doesn't inherit from Control class
it's not even supposed to be available @ design-tim
right Thanks in advanc
Rakes