private void Menu_FormClosing(object sender, FormClosingEventArgs e) { // Close old control with respect if (splitContainer1.Panel2.Controls.Count > 0) { EditTableControl old = (EditTableControl)splitContainer1.Panel2.Controls["EditTableControl"]; old.EasyClose(); } }
private void CloseEdit() { if (splitContainer1.Panel2.Controls.Count > 0) { EditTableControl old = (EditTableControl)splitContainer1.Panel2.Controls["EditTableControl"]; old.EasyClose(); } splitContainer1.Panel2.Controls.Clear(); }
private void treeView1_DoubleClick(object sender, EventArgs e) { if (treeView1.SelectedNode != null) { TreeNode node = treeView1.SelectedNode; int id = Convert.ToInt32(node.Tag); UserControl control = new EditTableControl(id); control.Dock = DockStyle.Fill; // Close old control with respect if (splitContainer1.Panel2.Controls.Count > 0) { EditTableControl old = (EditTableControl)splitContainer1.Panel2.Controls["EditTableControl"]; old.EasyClose(); } splitContainer1.Panel2.Controls.Clear(); splitContainer1.Panel2.Controls.Add(control); } }