private void InvokeSelectedTabChanged(object sender, EventArgs e)
        {
            SetRedraw(this, false);

            try
            {
                if (_selectedPage != null)
                {
                    _selectedPage.Visible = false;
                }

                _selectedPage = AeroTabPage.GetButtonPage(_tabStrip.SelectedTab);

                if (_selectedPage != null)
                {
                    _selectedPage.Visible = true;

                    _tabStrip.SendToBack();
                    _tabStrip.SelectedTab = _selectedPage.TabStripButton;

                    _selectedPage.Focus();
                    _selectedPage.SelectNextControl(_selectedPage, true, true, true, false);
                }
            }
            finally
            {
                SetRedraw(this, true);
                Invalidate(true);
            }

            OnSelectedTabChanged(e);
        }
        private void Remove(AeroTabPage page)
        {
            //BeginUpdate();

            //try
            //{
            if (_tabStrip.Items.Contains(page.TabStripButton))
            {
                _tabStrip.SuspendLayout();
                _tabStrip.Items.Remove(page.TabStripButton);
                _tabStrip.ResumeLayout();
            }

            if (_pages.Contains(page))
            {
                _pages.Remove(page);
            }

            UpdateTabStripVisibility();
            //}
            //finally
            //{
            //    EndUpdate();
            //}
        }
        private void Add(AeroTabPage page)
        {
            bool suspendPaint = (_hideSingleTab && (_pages.Count == 1));

            if (suspendPaint)
            {
                SetRedraw(this, false);
                SetRedraw(_tabStrip, false);
            }

            try
            {
                page.Visible = false;
                page.Dock    = DockStyle.Fill;

                _pages.Add(page);

                _tabStrip.SuspendLayout();
                _tabStrip.Items.Add(page.TabStripButton);
                _tabStrip.ResumeLayout();

                UpdateTabStripVisibility();
            }
            finally
            {
                if (suspendPaint)
                {
                    SetRedraw(_tabStrip, true);
                    SetRedraw(this, true);

                    Invalidate(true);
                }
            }
        }
        private void InvokeCloseButtonClicked(object sender, ToolStripItemEventArgs e)
        {
            var page = AeroTabPage.GetButtonPage(e.Item);

            if (page != null)
            {
                PerformCloseButtonClick(page);
            }
        }
            public override void AddRange(Control[] controls)
            {
                foreach (var item in controls)
                {
                    if (!(item is AeroTabPage))
                    {
                        throw new ArgumentException(Resources.Strings.TabControlInvalidPageType);
                    }
                }

                var pages = new AeroTabPage[controls.Length];

                controls.CopyTo(pages, 0);

                Owner.SuspendLayout();

                base.AddRange(pages);
                Owner.AddRange(pages);

                Owner.ResumeLayout();
            }
Exemple #6
0
 public TabPageButton(AeroTabPage page)
     : base(page.Text)
 {
     _page = page;
 }
Exemple #7
0
 public AeroTabPageEventArgs(AeroTabPage page)
 {
     _page = page;
 }
 public void PerformCloseButtonClick(AeroTabPage page)
 {
     OnCloseButtonClick(new AeroTabPageEventArgs(page));
 }