示例#1
0
 protected override void OnAfterTabClosed(GlyphTabControlEventArgs e)
 {
     if (e.TabPage is MdiTabPage mdiTabPage)
     {
         mdiTabPage.DeregisterDockPropertiesChangedEvent();
     }
     base.OnAfterTabClosed(e);
 }
示例#2
0
 protected override void OnTabNotifyChange(GlyphTabControlEventArgs e)
 {
     // Text of the active tab page may have been updated.
     if (e.TabPageIndex == ActiveTabPageIndex)
     {
         UpdateCaptionText(e.TabPageIndex);
     }
     base.OnTabNotifyChange(e);
 }
示例#3
0
        private void DockedControl_AfterTabRemoved(object sender, GlyphTabControlEventArgs e)
        {
            MdiTabControl mdiTabControl = (MdiTabControl)sender;

            if (mdiTabControl.TabPages.Count == 0)
            {
                // If the last tab page is closed, close the entire form.
                Close();
            }
            else if (mdiTabControl.ActiveTabPageIndex < 0)
            {
                // If the active tab page was closed, activate the tab page to the right. If there is none, go to the left.
                int targetIndex = e.TabPageIndex;
                if (targetIndex >= mdiTabControl.TabPages.Count)
                {
                    targetIndex = mdiTabControl.TabPages.Count - 1;
                }
                mdiTabControl.ActivateTab(targetIndex);
            }
        }
示例#4
0
 protected override void OnAfterTabActivated(GlyphTabControlEventArgs e)
 {
     UpdateCaptionText(e.TabPageIndex);
     base.OnAfterTabActivated(e);
 }