C # learning notes-MDI form (Multi-Document Interface ),

Source: Internet
Author: User

C # learning notes-MDI form (Multi-Document Interface ),

1. Set the parent form:

To set a form as the parent form, set the IsMdiContainer attribute of the form to True.

2. Set the subform:

Set the MdiParent attribute of a form to determine that the form is a subform of the form.

Syntax:

1: public Form MdiParent{get;set;}

3. Arrange the MDI subforms:

Syntax:

1: public void LayoutMdi(MdiLayout value)

Value: one of the enumerated values of MdiLayout, used to define the layout of the MDI child form.

Enumeration member Description
Cascade Cascade the MDI child forms
TileHorizontal Horizontal tiled MDI child form
TileVertical Vertical tiled MDI child form

Routine;

1: public partial class FormMain: Form 2: {3: public FormMain () 4: {5: InitializeComponent (); 6:} 7: 8: private void loading subform ToolStripMenuItem_Click (object sender, EventArgs e) 9: {10: FormChild_1 frm1 = new FormChild_1 (); 11: frm1.MdiParent = this; 12: frm1.Show (); 13: 14: FormChild_2 frm2 = new FormChild_2 (); 15: frm2.MdiParent = this; 16: frm2.Show (); 17: 18: FormChild_3 frm3 = new FormChild_3 (); 19: frm3.MdiParent = this; 20: frm3.Show (); 21:} 22: 23: private void horizontal tile ToolStripMenuItem_Click (object sender, EventArgs e) 24: {25: LayoutMdi (MdiLayout. tileHorizontal); 26:} 27: 28: private void vertically tiled ToolStripMenuItem_Click (object sender, EventArgs e) 29: {30: LayoutMdi (MdiLayout. tileVertical); 31 :}32: 33: private void stacked ToolStripMenuItem_Click (object sender, EventArgs e) 34: {35: LayoutMdi (MdiLayout. cascade); 36:} 37: 38 :}

Related Article

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.