Problem with .NET 2.0 MDI menu merging

D

Doug Harber

I've got 2 problems trying to get an MDI child form's menus to merge with
its parent's.

First, I created a simple MDI app with 2 forms, just for testing. The parent
form contains a menu with the following items:

&File
&New
&Open

The second form contains the following menus:

&File
&Test

These are created using MenuStrip and ToolStripMenuItem. The menus in the
parent form all have MergeAction/MergeIndex set to Append/-1. On the child
form, the &File menu item is MatchOnly/-1.

What happens is that when the parent form opens a child form, the &Test menu
correctly item shows up on the parent form's &File menu but the &File menu
item is still present on the child form.

So far the documentation has proved incredibly sketchy, even for Microsoft,
so I'm at a loss as to what I'm doing wrong or, perhaps, just failing to do
at all. All the samples I can find are simply concerned with putting merged
menu items at the top level.

The second problem may be an offshoot of the first in that I have a parent
and child form with much more complicated menu structures. When the parent
opens the form, no menu merging appears to take place at all. Unfortunately,
these forms are actually legacy code from .NET 1.1 that I'm porting to .NET
2.0. (Worse, they previously used a third-party menu library that I'm
attempting to replace with .NET 2.0's menus.) So, while I'm concerned about
solving this second problem, it may be an effect of some other code I may
have had to modify along the way. What concerns me chiefly is that even if I
solve this second problem, I'm going to be left with a problem similar to my
first problem.

So, does anyone know what I'm probably doing wrong? I know this kind of
thing must be done all the time so perhaps someone has stumbled across the
same mistake(s) I've probably made.

Thanks for any help,
Doug Harber
 
D

Doug Harber

First problem is apparently solved. Apparently you have to make the menu
invisible on the child form. Of course, nothing in the documentation or
samples suggests this (that I could find.)
 

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