C # learning Note--mdi form (multiple file interface)

Source: Internet
Author: User

1. Set the parent form:

If you want to set a form as a parent form, simply set the IsMdiContainer property of the form to true.

2. Set the subform:

Make sure that the form is a subform of that form by setting it to the MdiParent property of a form.

The syntax is as follows:

1  Public Form mdiparent{get;  Set;}

3. Arrange the MDI child form:

The syntax is as follows:

1  Public void LayoutMDI (mdilayout value)

Value: is one of the enumeration values for the MDILayout that defines the layout of the MDI child form.

Enumeration members Description
Cascade Stacking MDI child forms
Tilehorizontal Flat water spread MDI child form
Tilevertical Tile MDI child forms vertically

routines;

1: Public Partial classFormmain:form2:     {   3: PublicFormMain ()4:         {   5: InitializeComponent (); 6:         }   7:     8:Private voidLoad Subform Toolstripmenuitem_click (Objectsender, EventArgs e)9:         {  Ten: Formchild_1 Frm1 =Newformchild_1 ();  One: Frm1. MdiParent = This;  A: Frm1.  Show ();  -:     -: Formchild_2 Frm2 =Newformchild_2 ();  the: Frm2. MdiParent = This;  -: Frm2.  Show ();  -:     -: Formchild_3 FRM3 =Newformchild_3 ();  +: FRM3. MdiParent = This;  -: FRM3.  Show ();  +:         }   A:     at:Private voidPlain Water Shop toolstripmenuitem_click (Objectsender, EventArgs e) -:         {   -: LayoutMDI (mdilayout.tilehorizontal);  -:         }   -:     -:Private voidTile Vertically Toolstripmenuitem_click (Objectsender, EventArgs e) in:         {   -: LayoutMDI (mdilayout.tilevertical);  to:         }   +:     -:Private voidCascade Arrangement Toolstripmenuitem_click (Objectsender, EventArgs e) the:         {   *: LayoutMDI (Mdilayout.cascade);  $:         }  Panax Notoginseng:     -:     }

C # learning Note--mdi form (multiple file interface)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.