Can't edit a protected menustrip in an inherited form.

M

Michael.Suarez

I have a form in a windows control library with a menustrip on it. The
menustrip, as well as all of the items on it, have their modifiers set
to Protected.

Now i inherit from this form in another project. Neither the menu strip
nor any of its items can be editted... as if they are all private.

However, if i put a button on the form in the control library and make
it protected, I can do whatever i want with the button once i inherit.

What is the difference between the menustrip and the button that
doesn't allow me to have my way with the menustrip? is there a way to
fix this?
 
I

InK_

Hi, Michael

The difference is that menustrip is a collection of controls when button is
a single control.
The problem is because Microsoft limited changing of collections in
inherited forms.
You can read about this problem here:
http://cs.rthand.com/blogs/blog_with_righthand/archive/2005/11/10/186.aspx
For brief description of technical problems which were encountered by
Microsoft development team look at the comment of Shawn Burke (Development
Manager, Windows Forms Team)
 
M

Michael.Suarez

Thanks for that link. Very interesting.

My idea was to create a base form that already had a set of menu items
that all programs should have, already in its main menu. But it's
probably a better design to just have a base form and a base menustrip
and add the menustrip to the derived form anyway, especially
considering this limitation (or bug or feature, depending how you look
at it).
 

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