/// <summary> /// Removes a panel from the content tab control /// </summary> /// <param name="ControlToRemove">The panel to remove from the main tab control</param> public void RemoveContentPanel(MyPanel ControlToRemove) { if (!ControlToRemove.Removed) { ControlToRemove.Removed = true; ControlToRemove.OnPanelClosed(AssociatedForm); } ContentTabControl.RemovePanelFromControl(ControlToRemove); }
/// <summary> /// Removes a panel from the content tab control, triggers the PanelClosed event and re-draws the control. /// </summary> /// <param name="PanelToRemove">The panel to be removed from the tab control</param> public void RemovePanelFromControl(MyPanel PanelToRemove) { if (PanelToRemove.InContentPanel) { PanelsToDisplay.Remove(PanelToRemove); PanelToRemove.InContentPanel = false; PanelToRemove.OnPanelClosed(base.ParentForm); DisplayControls(); } }