父窗体的panel调用子窗体
private static Form1 form1; private void toolStripButton1_Click(object sender, EventArgs e) { this.btnjkst.BackgroundImage = Image.FromFile(Application.StartupPath + @"\img\buttonanxia.jpg"); forma(); curform = "f1"; } private void forma() { if (form1 == null || form1.IsDisposed) { Form1 sAllPage = new Form1(); sAllPage.TopLevel = false; this.panel1.Controls.Clear(); this.panel1.Controls.Add(sAllPage); sAllPage.Show(); sAllPage.WindowState = FormWindowState.Maximized; sAllPage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms