Example #1
0
        /// <summary>
        /// Adds the control.
        /// </summary>
        /// <param name="baseControl">The base control.</param>
        private void AddControl(Controls.BaseControl baseControl)
        {
            baseControl.Dock = DockStyle.Fill;

            var tabPage = new XtraTabPage();

            tabPage.Text  = " " + baseControl.Title; // Add a space for visual effect...
            tabPage.Image = baseControl.ImageTitle;

            baseControl.AddNewTab += baseControl_AddNewTab;
            tabPage.Controls.Add(baseControl);

            this.xtraTabControl.SelectedPageChanged -= xtraTabControl_SelectedPageChanged;
            this.xtraTabControl.CloseButtonClick    -= this.xtraTabControl_CloseButtonClick;

            this.xtraTabControl.TabPages.Add(tabPage);

            this.xtraTabControl.SelectedTabPage         = tabPage;
            this.xtraTabControl.HeaderButtonsShowMode   = TabButtonShowMode.WhenNeeded;
            this.xtraTabControl.ClosePageButtonShowMode = ClosePageButtonShowMode.InTabControlHeader;
            baseControl.Show();

            this.xtraTabControl.SelectedPageChanged += xtraTabControl_SelectedPageChanged;
            this.xtraTabControl.CloseButtonClick    += this.xtraTabControl_CloseButtonClick;
        }
Example #2
0
 /// <summary>
 /// Bases the control_ add new tab.
 /// </summary>
 /// <param name="baseControl">The base control.</param>
 private void baseControl_AddNewTab(Controls.BaseControl baseControl)
 {
     this.AddControl(baseControl);
 }