How do I get the Forms Designer MainMenu object to generate code which uses my MenuItems instead of

G

Guest

I've created a derived MenuItem class. How do I get the Forms Designer MainMenu object to generate code which uses my MenuItems instead of the base MenuItems? Base MenuItems is ReadOnly how can I supress it
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?TmlsZXNoIFJhZGU=?= said:
I've created a derived MenuItem class. How do I get the Forms Designer
MainMenu object to generate code which uses my MenuItems instead of the
base MenuItems? Base MenuItems is ReadOnly how can I supress it?

AFAIS that's not possible.
 
N

Nilesh Rade

Thanks a lot Mr.Wagner.
Actually I am developing Custom Menus.I inherited MenuItem class but was
facing problem when i am inheriting MainMenu class. MainMenu Class is
having a MenuItems collection which is readonly and I can't assign
collecion of my MenuItem class derived from MenuItem??

Does this means that i have to develop my own menus can can't inherit
form MenuItem, MainMenu and Context Menu Classes.
 
G

Guest

Thanks a lot Mr.Wagner
Actually I am developing Custom Menus.I inherited MenuItem class but was facing problem when i am inheriting MainMenu class. MainMenu Class is having a MenuItems collection which is readonly and I can't assign collecion of my MenuItem class derived from MenuItem. I have to add a designer to this Inherited MainMenu Class which will take my inherited MenuItem Collection

Does this means that i have to develop my own menus can can't inherit form MenuItem, MainMenu and Context Menu Classes

Please suggest.

----- Herfried K. Wagner [MVP] wrote: ----

* "=?Utf-8?B?TmlsZXNoIFJhZGU=?= said:
I've created a derived MenuItem class. How do I get the Forms Designe
MainMenu object to generate code which uses my MenuItems instead of th
base MenuItems? Base MenuItems is ReadOnly how can I supress it

AFAIS that's not possible
 
H

Herfried K. Wagner [MVP]

* Nilesh Rade said:
Actually I am developing Custom Menus.I inherited MenuItem class but was
facing problem when i am inheriting MainMenu class. MainMenu Class is
having a MenuItems collection which is readonly and I can't assign
collecion of my MenuItem class derived from MenuItem??

You can add menuitems derived from the 'MenuItem' class, but you will
have to perform an explicit cast ('DirectCast' in VB.NET).
Does this means that i have to develop my own menus can can't inherit
form MenuItem, MainMenu and Context Menu Classes.

You can inherit from 'MenuItem', for the other classes, have a look at
the documentation if they are marked as 'NotInheritable'.
 
G

Guest

Actually I am developing Custom Menus.I inherited MenuItem class but was facing problem when i am inheriting MainMenu class. MainMenu Class is having a MenuItems collection which is readonly and I can't assign collecion of my MenuItem class derived from MenuItem. I have to add a designer to this Inherited MainMenu Class which will take my inherited MenuItem Collection
 

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