//////窗體顯示到容器中 /// ///要顯示的窗體對象 privatevoid FromShowDialog(Formfrm) { //窗口置頂 frm.TopLevel = false; //移除Panel容器里所有窗體 foreach(Control ctl inpanel_right.Controls) { if (ctl is Form) { panel_right.Controls.Remove(ctl); } } //設(shè)置父容器 frm.Parent = this.panel_right; //窗體無邊框 frm.FormBorderStyle = FormBorderStyle.None; //填滿父容器 frm.Dock = DockStyle.Fill; frm.Show(); }