Ejemplo n.º 1
0
        /// <summary>
        /// Adds a panel to the tab control and re-draws the control.
        /// </summary>
        /// <param name="PanelToAdd">The panel to be added to the control.</param>
        public void AddPanelToTabControl(MyPanel PanelToAdd)
        {
            if (!PanelToAdd.InContentPanel)
            {
                PanelsToDisplay.Add(PanelToAdd);
                PanelToAdd.RemoveToolbarButtons();
                PanelToAdd.PanelIndex     = PanelsToDisplay.Count - 1;
                PanelToAdd.InContentPanel = true;

                //Add tool strip button to close the panel.
                MyToolStripButton ButtonToAdd;
                ButtonToAdd                = new MyToolStripButton(PanelsToDisplay.Count - 1);
                ButtonToAdd.Text           = PanelToAdd.Name;
                ButtonToAdd.ButtonClicked += tempButton_CustomCheckedChanged;
                closePanels.DropDownItems.Add(ButtonToAdd);

                DisplayControls();
            }
        }