Design a multi-Document Interface (MDI) application to open, arrange, and close subwindows ., One multiple mdi

Source: Internet
Author: User

Design a multi-Document Interface (MDI) application to open, arrange, and close subwindows ., One multiple mdi

 

First, we need to know what is the multi-Document Interface (MDI)

In theory, it is "developed and designed in a multi-document window environment. This multi-document interface is called the multi-Document Interface (mdi )"

The most common Excel sheet is mdi.

[My personal understanding is like this]

 

Start the actual operation:

1. Open two forms. Form2 is the main form and Form2_son is the subform]

2. Drag the control in the main form Form2

MenuStrip (menu bar)

 

 

Set IsMdiContainer = True for form2

3. Drag the control in the subform Form2_son.

RichTextBox (full window duck attribute)

4. Code in Form2

Private void open the subwindow ToolStripMenuItem_Click (object sender, EventArgs e) {Form2_son myChild = new Form2_son (); myChild. MdiParent = this; myChild. Show ();}
 
1 // Close the subform of the current activity 2 private void Close the subwindow ToolStripMenuItem_Click (object sender, EventArgs e) 3 {4 ActiveMdiChild. Close (); 5}
Private void close all subwindows ToolStripMenuItem_Click (object sender, EventArgs e) {if (MdiChildren. length> 0) {foreach (Form myForm in mdichil.pdf) {myForm. close ();}}}
// Exit the program
Private void Exit ToolStripMenuItem_Click (object sender, EventArgs e) {Application. Exit ();}

  

// The form is arranged by LayoutMdi () where the parameter is the enumerated Value

MdiLayout. Cascade // Cascade

MdiLayout. TileHorizontal // horizontal Tile

MdiLayout. TileVertical // vertically tiled

Private void stacked ToolStripMenuItem_Click (object sender, EventArgs e) {this. layoutMdi (MdiLayout. cascade);} private void horizontally tiled ToolStripMenuItem_Click (object sender, EventArgs e) {this. layoutMdi (MdiLayout. tileHorizontal );}

  

 

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.