473,789 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MenuStrip -- Mdi merge

Could someone explain how to merge the form menu with the mdi container
window. The menu strip items on the form window merge but I either end up
with a blank blue menu on the form or top list of items that don't do
anything.

MDI Container.IsMdi Container = true

MenuStrip.Allow Merge = true
/// First menu items
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.Insert;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

/// On the sub form
this.miFile.Dro pDownItems.AddR ange(new System.Windows. Forms.ToolStrip Item[]
{
this.toolStripS eparator1,
this.miClose});
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.MatchOnly;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

Regards,
John
Dec 15 '05 #1
4 21684
I struggled with this for ages and eventually, by trial and error, got it
working. Best to show where I got to with an illustration of the MergeAction
and MergeIndex values

MDI parent form has a "File" menu with the generally available options:

Item Merge Action Merge Index
File Append 1
New Append 2
Open Append 2
Print Setup Append 25
Exit Append 99

All of these items are handled by methods on the MDI parent form.

The MDI child form also has a file menu, with options specific to a child
form:

Item Merge Action Merge Index
File MatchOnly -1
Close Insert 2 (Inserts
Close after item 2)
---- Insert 3 (separator
bar)
Save Insert 4
Save-as Insert 5
----- Insert 6
Print Insert 7
Print Preview Insert 8

All of these menu items are handled by methods on the mdi child form. When a
child form is opened, the entire child menu gets merged between the "open"
and "Print setup" items of the parent menu.

Next job was to insert an "edit" menu after the "file" menu. Since there is
no such menu on the parent form, I needed to add a new one from the child
form. On the child, I defined:

Item Merge Action Merge Index
Edit Insert 2
Undo Append -1
< rest of the options are the same >

In this case, because the Edit menu is a top level menu, it gets inserted
after top level item "1", which is the "file" menu from the parent form.
Because there is no merging of lower level items, I can append them all in
the child form.

Hope some of that makes sense. I have no idea whether it's the "right" thing
to do because the documentation and examples are non-existent. However, it
works.

You'll also be pleased to know that, when you come to merge toolbars, the
rules change completely!

HTH
Steve

"John J. Hughes II" <no@invalid.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Could someone explain how to merge the form menu with the mdi container
window. The menu strip items on the form window merge but I either end up
with a blank blue menu on the form or top list of items that don't do
anything.

MDI Container.IsMdi Container = true

MenuStrip.Allow Merge = true
/// First menu items
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.Insert;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

/// On the sub form
this.miFile.Dro pDownItems.AddR ange(new
System.Windows. Forms.ToolStrip Item[] {
this.toolStripS eparator1,
this.miClose});
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.MatchOnly;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

Regards,
John

Dec 16 '05 #2
Steve,

First thanks for the detailed response.

I sort of fixed the problem by setting the child form's menu strip visible
property to false.

I change my menus based on your suggestion. Mainly changed the parent menu
upper items to "Append" with the location index being correct for where I
want them. Then I changed the child form menu items parents to -1 / match
only. I can only assume they are using the name to match with so I made
sure the name are the same.

All the sub items are merging correctly on the parent menu but the child
form still has a menu strip with a list of parent items that does nothing.
Oh well as I said I changed the child menu form's menu strip visible
property to false and the problem seems to be solved.

And yes I agree a good sample would be nice from MS. The compression sample
the BOL leads you too is beyond useless.

Don't you just love guessing games?

Regards,
John

"Steve Barnett" <no****@nodomai n.com> wrote in message
news:eJ******** ********@TK2MSF TNGP11.phx.gbl. ..
I struggled with this for ages and eventually, by trial and error, got it
working. Best to show where I got to with an illustration of the
MergeAction and MergeIndex values

MDI parent form has a "File" menu with the generally available options:

Item Merge Action Merge Index
File Append 1
New Append 2
Open Append 2
Print Setup Append 25
Exit Append 99

All of these items are handled by methods on the MDI parent form.

The MDI child form also has a file menu, with options specific to a child
form:

Item Merge Action Merge Index
File MatchOnly -1
Close Insert 2 (Inserts
Close after item 2)
---- Insert 3 (separator
bar)
Save Insert 4
Save-as Insert 5
----- Insert 6
Print Insert 7
Print Preview Insert 8

All of these menu items are handled by methods on the mdi child form. When
a child form is opened, the entire child menu gets merged between the
"open" and "Print setup" items of the parent menu.

Next job was to insert an "edit" menu after the "file" menu. Since there
is no such menu on the parent form, I needed to add a new one from the
child form. On the child, I defined:

Item Merge Action Merge Index
Edit Insert 2
Undo Append -1
< rest of the options are the same >

In this case, because the Edit menu is a top level menu, it gets inserted
after top level item "1", which is the "file" menu from the parent form.
Because there is no merging of lower level items, I can append them all in
the child form.

Hope some of that makes sense. I have no idea whether it's the "right"
thing to do because the documentation and examples are non-existent.
However, it works.

You'll also be pleased to know that, when you come to merge toolbars, the
rules change completely!

HTH
Steve

"John J. Hughes II" <no@invalid.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Could someone explain how to merge the form menu with the mdi container
window. The menu strip items on the form window merge but I either end
up with a blank blue menu on the form or top list of items that don't do
anything.

MDI Container.IsMdi Container = true

MenuStrip.Allow Merge = true
/// First menu items
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.Insert;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

/// On the sub form
this.miFile.Dro pDownItems.AddR ange(new
System.Windows. Forms.ToolStrip Item[] {
this.toolStripS eparator1,
this.miClose});
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.MatchOnly;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

Regards,
John


Dec 16 '05 #3
Sorry, yes, you're right - I didn't say to hide the menu strip on the child
form. I am doing that too.

The items that are appropriate for the parent form are handled by the parent
form... that's where I put their handlers. This for the child are handled by
the child because that's where I put their handlers. I have no "duplicate"
items on both forms though... you seem to imply you do.

You'll have far more fun when you get to merge tool bars - they merged
automatically in the Beta version of VC# Express and then stopped merging
automatically in the final release. I now have to merge them my self with
some very unintuitive code.

At some stage, I may strip out the more advanced stuff I put in to my editor
and upload it as an example to CodeProject... either that or I'll have
Christmas off!

All the best
Steve
"John J. Hughes II" <no@invalid.com > wrote in message
news:uu******** *****@TK2MSFTNG P12.phx.gbl...
Steve,

First thanks for the detailed response.

I sort of fixed the problem by setting the child form's menu strip visible
property to false.

I change my menus based on your suggestion. Mainly changed the parent
menu upper items to "Append" with the location index being correct for
where I want them. Then I changed the child form menu items parents to -1
/ match only. I can only assume they are using the name to match with so
I made sure the name are the same.

All the sub items are merging correctly on the parent menu but the child
form still has a menu strip with a list of parent items that does nothing.
Oh well as I said I changed the child menu form's menu strip visible
property to false and the problem seems to be solved.

And yes I agree a good sample would be nice from MS. The compression
sample the BOL leads you too is beyond useless.

Don't you just love guessing games?

Regards,
John

"Steve Barnett" <no****@nodomai n.com> wrote in message
news:eJ******** ********@TK2MSF TNGP11.phx.gbl. ..
I struggled with this for ages and eventually, by trial and error, got it
working. Best to show where I got to with an illustration of the
MergeAction and MergeIndex values

MDI parent form has a "File" menu with the generally available options:

Item Merge Action Merge Index
File Append 1
New Append 2
Open Append 2
Print Setup Append 25
Exit Append 99

All of these items are handled by methods on the MDI parent form.

The MDI child form also has a file menu, with options specific to a child
form:

Item Merge Action Merge Index
File MatchOnly -1
Close Insert 2 (Inserts
Close after item 2)
---- Insert 3
(separator bar)
Save Insert 4
Save-as Insert 5
----- Insert 6
Print Insert 7
Print Preview Insert 8

All of these menu items are handled by methods on the mdi child form.
When a child form is opened, the entire child menu gets merged between
the "open" and "Print setup" items of the parent menu.

Next job was to insert an "edit" menu after the "file" menu. Since there
is no such menu on the parent form, I needed to add a new one from the
child form. On the child, I defined:

Item Merge Action Merge Index
Edit Insert 2
Undo Append -1
< rest of the options are the same >

In this case, because the Edit menu is a top level menu, it gets inserted
after top level item "1", which is the "file" menu from the parent form.
Because there is no merging of lower level items, I can append them all
in the child form.

Hope some of that makes sense. I have no idea whether it's the "right"
thing to do because the documentation and examples are non-existent.
However, it works.

You'll also be pleased to know that, when you come to merge toolbars, the
rules change completely!

HTH
Steve

"John J. Hughes II" <no@invalid.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Could someone explain how to merge the form menu with the mdi container
window. The menu strip items on the form window merge but I either end
up with a blank blue menu on the form or top list of items that don't do
anything.

MDI Container.IsMdi Container = true

MenuStrip.Allow Merge = true
/// First menu items
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.Insert;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

/// On the sub form
this.miFile.Dro pDownItems.AddR ange(new
System.Windows. Forms.ToolStrip Item[] {
this.toolStripS eparator1,
this.miClose});
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.MatchOnly;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

Regards,
John



Dec 16 '05 #4
Yea it was the visable thing that was throwing me. Very not obvious!

Just the parent items are common form the form to the parent. It was just
having the parent item on both the form and the container was a bit
confusing and ugly.

I don't think I will do the toolbar thing. I don't have much of a problem
on the few windows I have that use them just being on the form itself.

Thanks again for the help.

Regards,
John

"Steve Barnett" <no****@nodomai n.com> wrote in message
news:em******** *****@TK2MSFTNG P11.phx.gbl...
Sorry, yes, you're right - I didn't say to hide the menu strip on the
child form. I am doing that too.

The items that are appropriate for the parent form are handled by the
parent form... that's where I put their handlers. This for the child are
handled by the child because that's where I put their handlers. I have no
"duplicate" items on both forms though... you seem to imply you do.

You'll have far more fun when you get to merge tool bars - they merged
automatically in the Beta version of VC# Express and then stopped merging
automatically in the final release. I now have to merge them my self with
some very unintuitive code.

At some stage, I may strip out the more advanced stuff I put in to my
editor and upload it as an example to CodeProject... either that or I'll
have Christmas off!

All the best
Steve
"John J. Hughes II" <no@invalid.com > wrote in message
news:uu******** *****@TK2MSFTNG P12.phx.gbl...
Steve,

First thanks for the detailed response.

I sort of fixed the problem by setting the child form's menu strip
visible property to false.

I change my menus based on your suggestion. Mainly changed the parent
menu upper items to "Append" with the location index being correct for
where I want them. Then I changed the child form menu items parents
to -1 / match only. I can only assume they are using the name to match
with so I made sure the name are the same.

All the sub items are merging correctly on the parent menu but the child
form still has a menu strip with a list of parent items that does
nothing. Oh well as I said I changed the child menu form's menu strip
visible property to false and the problem seems to be solved.

And yes I agree a good sample would be nice from MS. The compression
sample the BOL leads you too is beyond useless.

Don't you just love guessing games?

Regards,
John

"Steve Barnett" <no****@nodomai n.com> wrote in message
news:eJ******** ********@TK2MSF TNGP11.phx.gbl. ..
I struggled with this for ages and eventually, by trial and error, got it
working. Best to show where I got to with an illustration of the
MergeActio n and MergeIndex values

MDI parent form has a "File" menu with the generally available options:

Item Merge Action Merge Index
File Append 1
New Append 2
Open Append 2
Print Setup Append 25
Exit Append 99

All of these items are handled by methods on the MDI parent form.

The MDI child form also has a file menu, with options specific to a
child form:

Item Merge Action Merge Index
File MatchOnly -1
Close Insert 2 (Inserts
Close after item 2)
---- Insert 3 (separator bar)
Save Insert 4
Save-as Insert 5
----- Insert 6
Print Insert 7
Print Preview Insert 8

All of these menu items are handled by methods on the mdi child form.
When a child form is opened, the entire child menu gets merged between
the "open" and "Print setup" items of the parent menu.

Next job was to insert an "edit" menu after the "file" menu. Since there
is no such menu on the parent form, I needed to add a new one from the
child form. On the child, I defined:

Item Merge Action Merge Index
Edit Insert 2
Undo Append -1
< rest of the options are the same >

In this case, because the Edit menu is a top level menu, it gets
inserted after top level item "1", which is the "file" menu from the
parent form. Because there is no merging of lower level items, I can
append them all in the child form.

Hope some of that makes sense. I have no idea whether it's the "right"
thing to do because the documentation and examples are non-existent.
However, it works.

You'll also be pleased to know that, when you come to merge toolbars,
the rules change completely!

HTH
Steve

"John J. Hughes II" <no@invalid.com > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Could someone explain how to merge the form menu with the mdi container
window. The menu strip items on the form window merge but I either end
up with a blank blue menu on the form or top list of items that don't
do anything.

MDI Container.IsMdi Container = true

MenuStrip.Allow Merge = true
/// First menu items
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.Insert;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

/// On the sub form
this.miFile.Dro pDownItems.AddR ange(new
System.Windows. Forms.ToolStrip Item[] {
this.toolStripS eparator1,
this.miClose});
this.miFile.Mer geAction = System.Windows. Forms.MergeActi on.MatchOnly;
this.miFile.Mer geIndex = 1;
this.miFile.Nam e = "miFile";
this.miFile.Siz e = new System.Drawing. Size(35, 20);
this.miFile.Tex t = "&File";

Regards,
John



Dec 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1464
by: Javier Alpizar | last post by:
Hi, I'm setting the Allowmerge property of both the parent and child menustrip but it doesn't work. I get two different menus instead of merged one when I open a child window. Am I missing something? Thank you.
5
5485
by: Alvo von Cossel I | last post by:
hi, i have a modern looking application without the cotrolbox-bar because i've created my own. i have a restore down button with an image that has a grey background. if the user has a different XP style then the button will look weird. how can i make the menustrip not change colour when the user of the PC changes their XP style? -- Alvo von Cossel I of Germany
0
1850
by: rellik | last post by:
Hi All, I've run into a problem with the MenuStrip control and any help would be greatly appreciated! The problem I've got is that when use a control derived from the MenuStrip class all MDI merge functionality breaks - each MDI child window is given it's own menu rather than the mdi parent. To repeat the problem just create a very simple dummy app that has standard
0
2029
by: academic | last post by:
I'm having a problem merging a ContextMenuStrip for a UserControl to the MenuStrip on the form containing the UserControl. I tried the following thinking that it is equivalent to cloning the ContextStrip menu Thanks for Any helpful suggestions?
0
2391
by: academic | last post by:
Using ToolStripManager.Merge(ToolStrip,ToolStrip) I've been able to merge a MenuStrip into a MenuStrip but never a ContextMenuStrip into a MenuStrip. From the docs it seems to me I should be able to.
1
4963
by: MyndPhlyp | last post by:
Newbie alert! VB 2005 Express. One MDIParent form and one regular Form. The MDIParent has the standard ToolStrip. The MDI Child Form has its own ToolStrip that is to be merged onto the MDIParent's ToolStrip. Sounds simple, right? I've gone through quite a few URLs that all pretty much say the same thing but I have yet to get this completely working. (Most of those URLs also seem to wander away from ToolStrip and instead go down the...
0
1656
by: Chris Peeters | last post by:
Hi, I have an MDI-application running with 1 MDI chilld showing in 'Normal'-WindowState, so NOT maximized. What I see is the MDI-main window showing its title bar, below that the menustrip with merged-menuitems and the MDI-child window 'floating' within the MDI-container just showing an icon + title in its title bar. So far so good. But when I maximize the MDI-child window ... what i see then is the
0
3209
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello all, Is there anyway to stop a child form's minimize,maximize,close and system menu from automatically merging with the MDI parent's menustrip when you click the maximize button on the child? I'm able to catch the WM_GETMINMAXINFO message in WndProc and I can adjust the MinTrackSize, MaxTrackSize. I just can't for the life of me stop it from merging into the parent.
0
5058
by: kyungdongkim | last post by:
Hi, I have a dynamically generated MenuStrip following this example: http://www.codeproject.com/useritems/Dynamic_MenuStrip.asp Basically the menu strip allows users to save and load reports. The Load menu is to list all the saved reports. I need to refresh the Load menu after a new report is saved. Any help is much appreciated! Code:
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.