[C#][WinForm]MDI form
【C#】【WinForm】MDI Form Related learning and use of MDI forms 1. Set the MDI parent form Find the IsMdiContainer option in the properties and set it to True 2. To add an MDI subform, select Add -> Form in the project, and then leave it as default The added project directory (Form1 is the parent window, Form2 and Form3 are child windows) 3. In Form1.cs, create an object corresponding to the MDI sub-window and call it to display 1 namespace WindowsFormsApp1 2 { 3 public span> partial class Form1 : Form 4 { 5 public span> Form1() 6 { 7 InitializeComponent() ; 8 } 9 10 private void Form1_Load(object sender, EventArgs e) 11 { 12 Form form2 = new Form2(); 13 form2.Show (); 14 form2.MdiParent = this; 15 Form form3 = new Form3(); 16 form3.Show (); 17 form3.MdiParent = this; 18 } 19 } 20 } After saving and running, all sub-windows will be displayed. 4. Arrange and display sub-windows in a specific way Required controls (Menu and Toolbar -> Menu Strip) Add Items in sequence in the design interface Double-click each Item in order, and then add the following code to the Form1.cs file: private void Arrange ToolStripMenuItem_Click(object sender, EventArgs…
[C#][WinForm]MDI form
[C#][WinForm]MDI form Related learning and use of MDI forms 1. Set the MDI parent form Find the IsMdiContainer option in the properties and set it to True 2. To add an MDI subform, select Add -> Form in the project, and then leave it as default The added project directory (Form1 is the parent window, Form2 and Form3 are child windows) 3. In Form1.cs, create an object corresponding to the MDI sub-window and call it to display 1 namespace WindowsFormsApp1 2 { 3 public span> partial class Form1 : Form 4 { 5 public span> Form1() 6 { 7 InitializeComponent() ; 8 } 9 10 private void Form1_Load(object sender, EventArgs e) 11 { 12 Form form2 = new Form2(); 13 form2.Show (); 14 form2.MdiParent = this; 15 Form form3 = new Form3(); 16 form3.Show (); 17 form3.MdiParent = this; 18 } 19 } 20 } After saving and running, all sub-windows will be displayed. 4. Arrange and display sub-windows in a specific way Required controls (Menu and Toolbar -> Menu Strip) Add Items in sequence in the design interface Double-click each Item in order, and then add the following code to the Form1.cs file: private void Arrange ToolStripMenuItem_Click(object sender, EventArgs…