protected override void OnAfterTabClosed(GlyphTabControlEventArgs e) { if (e.TabPage is MdiTabPage mdiTabPage) { mdiTabPage.DeregisterDockPropertiesChangedEvent(); } base.OnAfterTabClosed(e); }
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); }
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); } }
protected override void OnAfterTabActivated(GlyphTabControlEventArgs e) { UpdateCaptionText(e.TabPageIndex); base.OnAfterTabActivated(e); }