Merging menu items for MDI container and MDI child forms

Say, if MDI container has a "About" Menu that the MDI child forms need to merge with.

Set the MDI container menu in such manner. (In the InitializeComponent or change it using the IDE property window)

this.menuItemAbout.Index = 1;
this.menuItemAbout.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItemMainHelp});
this.menuItemAbout.MergeOrder = 1;
this.menuItemAbout.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
this.menuItemAbout.Text = "Help";

this.menuItemMainHelp.Index = 0;
this.menuItemMainHelp.MergeOrder = 1000; //this need to be larger than the child so that it appear //underneath the child menu items.
this.menuItemMainHelp.Text = "Main Help";
this.menuItemMainHelp.MergeType = System.Windows.Forms.MenuMerge.Add;


Set MDI child forms in such manner. (In the InitializeComponent or change it using the IDE property window)

this.menuItemAbout.Index = 1;

this.menuItemAbout.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItemChildHelp});
this.menuItemAbout.MergeOrder = 1;
this.menuItemAbout.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
this.menuItemAbout.Text = "Help";


this.menuItemChildHelp.Index = 0;
this.menuItemChildHelp.MergeOrder = 100;
this.menuItemChildHelp.Text = "My Child Help";
this.menuItemChildHelp.MergeType = System.Windows.Forms.MenuMerge.Add;
this.menuItemChildHelp.Click += new System.EventHandler(this.menuItemChildHelp_Click);



Comments

Popular posts from this blog

Outlook : "operation failed, object could not be found. " when trying to close a PST.

How to transfer app and data from old iPhone to new iPhone for model IOS17 and IOS18 above.

Tips on how to use IBM iNotes (web client) on emailing or scheduling - Like copy tables from Excel or checking for user id (windows logon id) through email address