Once theMDI child form is enlarged, the subform icon crosses the menu bar and runs to the top.
Sets the Mainmenustrip property in the parent window to the menustrip! of the parent window
Two
1. Establish the MainForm (set attribute ismdicontainer=true) parent form as shown below.
2. Double-click the Form1 icon on the toolbar. Sets the display for the Form1 subform.
The Form1 Subform display code is as follows:
Private void Toolstripbutton1_click (objectsender, EventArgs e)
{
Form1 f1= new Form1 ();
F1. WindowState = formwindowstate.normal;
F1. MdiParent = this ;
F1. Show ();
}
3. Select the menu bar MenuStrip1 to set its ItemAdded event.
The ItemAdded event code for MENUSTRIP1 is as follows:
Private void menustrip1_itemadded (objectsender, toolstripitemeventargs e)
{
if (e.item.text.length = = 0 // Hide child form icon
|| E.item.text = = " minimize (&n)" // Hide Minimize button
|| E.item.text = = " restore (&r)" // Hide Restore button
|| E.item.text = = " off (&c)")// Hide most Close button
{
E.item.visible = false;
}
}