using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace mdiparent_example { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void closeToolStripMenuItem_Click(object sender, EventArgs e) { this.Dispose(); } private void childWindow1ToolStripMenuItem_Click(object sender, EventArgs e) { Form ChildForm1 = new Form(); ChildForm1.MdiParent = this; // ChildForm1.FormBorderStyle = FormBorderStyle.None; ChildForm1.Dock = DockStyle.Fill; ChildForm1.Show(); } private void childWindow2ToolStripMenuItem_Click(object sender, EventArgs e) { Form ChildForm2 = new Form(); ChildForm2.MdiParent = this; // ChildForm2.FormBorderStyle = FormBorderStyle.None; ChildForm2.Dock = DockStyle.Fill; ChildForm2.Show(); } } }
namespace mdiparent_example { public partial class ChildForm1 : Form { public ChildForm1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.Dispose(); } private void button2_Click(object sender, EventArgs e) { this.Dispose(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)