private void Svm_MainForm_Load(object sender, EventArgs e) { Form_Onduty form = new Form_Onduty(); form.TopLevel = false; form.Parent = this.TagContent; this.TagContent.Controls.Add(form); this.TagContent.Controls.SetChildIndex(form, 0); form.Dock = DockStyle.Fill; form.Show(); Lform = form; }
private void btn_Onduty_Click(object sender, EventArgs e) { if (Lform != null) { Lform.Close(); } Form_Onduty form = new Form_Onduty(); form.TopLevel = false; form.Parent = this.TagContent; this.TagContent.Controls.Add(form); this.TagContent.Controls.SetChildIndex(form, 0); form.Dock = DockStyle.Fill; form.Show(); Lform = form; }