MainMenu in MDI form

M

Mark Rae

Hi,

I have an MDI Windows app, and have created a menu for the MDI Container
form to open child windows etc. I used the MainMenu Designer from the
Toolbox to create the menu. I have attached it to the MDI Container form by
setting the Menu property in its Properties window. The menu displays
correctly in the Visual Studio IDE but, when I launch the app, the menu does
not appear. If I try to interrogate the this.Menu property in debug, I get
the error:

An unhandled exception of type 'System.NullReferenceException' occurred in
KFI.exe

Additional information: Object reference not set to an instance of an
object.

So, is setting a MDI Container form's Menu property not enough?

I've tried to set the MDI Container's Menu explicitly in code using its
this.Menu property in the
private void InitializeComponent()

section of its code, but don't seem to be able to reference the menu I
created with the MainMenu Designer.

Any assistance gratefully received.

Best regards,

Mark Rae
 

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