public static BodyTakeExam createForm() { if (instance == null || instance.IsDisposed) { instance = new BodyTakeExam(); } return instance; }
private void exMenu3_Click(object sender, EventArgs e) { this.lbl_mian.Text = "考试管理"; panel5.Hide(); this.titlename.Text = ((ToolStripMenuItem)sender).Text; MainFrame mainFrame = MainFrame.createForm(); mainFrame.panel6.Controls.Clear(); mainFrame.panel6.Controls.AddRange(mainFrame.items.ToArray()); BodyTakeExam bodyTakeExam = new BodyTakeExam(); bodyTakeExam.mainFrame = this; bodyTakeExam.TopLevel = false; bodyTakeExam.FormBorderStyle = FormBorderStyle.None; bodyTakeExam.Dock = System.Windows.Forms.DockStyle.Fill; panel6.Controls.Add(bodyTakeExam); bodyTakeExam.Show(); }