/// <summary>
 /// Adds a control to the form.
 /// </summary>
 /// <param name="ControlToAdd">The IDockableControl to add to the form</param>
 public void AddPanel(IDockableControl ControlToAdd)
 {
     if (ControlToAdd != null && ControlToAdd.Removed)
     {
         MainPanel.AddControl(ControlToAdd, true);
         if (ControlToAdd.Type == typeof(MyPanel))
         {
             Toolbar.AddPanel(((MyPanel)ControlToAdd).PanelIndex);
             ((MyPanel)ControlToAdd).OnPanelOpened(AssociatedForm);
         }
         if (ControlToAdd.Type == typeof(MyToolbar))
         {
             ControlToAdd.Removed = false;
         }
     }
     FlowLayoutEvents.OnMainPanelLayoutChanged();
 }