|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can't edit a protected menustrip in an inherited form.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? 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) -- Show quoteRegards, Inna Stetsyak aka InK_ <Michael.Sua***@gmail.com> wrote in message news:1141337420.691827.254190@i39g2000cwa.googlegroups.com... > 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? > 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). |
|||||||||||||||||||||||