How to prevent automatic menu merge in MDI

  • Thread starter Thread starter jon morgan
  • Start date Start date
J

jon morgan

Hello,

In an MDI application how can I prevent the CLR automatically merging a
child windows' menu with that of the parent MDI form ?

Thanks for any help

Jon
 
Jon,
I'm not sure if you can prevent the merge itself, however I would expect you
can mask the effect of the merge by using MenuMerge.Remove or
MenuMerge.Replace for the MenuItem.MergeType. Of course you could simply not
add a menu to the MDI child then the merge naturally will not occur. Somehow
I do not think this is what you mean ;-)

Which raises two questions:
- Why do you want to prevent it?
- What you are expecting instead?

The reason I ask, there may be 'better' alternatives rather then preventing
the merging.

Hope this helps
Jay
 
Thanks Jay,

I'm implementing various child windows (egPrintPreview) where the user would
expect to see an approriate menu attached to the child and not the parent.
It just wasn't an issue in VB6 and much as I can see the power of menu merge
I don't see why we shouldn't have the option to "turn it off".

Regards

Jon
 
Jon,
I'm implementing various child windows (egPrintPreview) where the user would
expect to see an approriate menu attached to the child and not the parent.
Don't make the form a MDI child then.

The Windows Standard is to have a single menu in the MDI Parent. The
framework adheres to this standard. As far as I can tell VB6 also adheres to
this standard. (when working with MDI Forms & MDI children).

In VB6 the only option I see is to replace the MDI parent menu. Where as
VB.NET allows you to merge the menu with the parent, which is significantly
more flexible. The parent has common options, the child has child specific
options. In both cases this menu is displayed as part of the MDI parent.

Have you looked at either using Form.ShowDialog(owner) to show your print
preview window (which prevents the user from going back to the MDI parent)
or use Form.Owner to set the owner of the child to the parent.

Hope this helps
Jay
 
Thanks Jay,

You are quite correct of course - my Vb6 forms weren't MDI and Form.Owner
should do the trick. Thanks for setting me straight.

Regards

Jon
 
Back
Top