主要會有一個父視窗,父視窗會有許多的子視窗在裡面;其實寫得時候比較不會有太大感受,除非哪天使用多視窗在同一個介面裡
Parent Form
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 MDIForm { public partial class ParentForm : Form { public ParentForm() { InitializeComponent(); } private void button_Click(object sender, EventArgs e) { this.IsMdiContainer = true; ChildForm bForm = new ChildForm(); bForm.MdiParent = this; bForm.Show(); } } }
Child Form
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 MDIForm { public partial class ChildForm : Form { public ChildForm() { InitializeComponent(); } } }
參考資料:
http://www.c-sharpcorner.com/UploadFile/ggaganesh/DevelopingMDIAppplicationsinCSharp11272005225843PM/DevelopingMDIAppplicationsinCSharp.aspx
http://www.cnblogs.com/scottckt/archive/2008/01/19/1045141.html
http://blog.csdn.net/hdaerduo/article/details/643179