Is there a way to select the previous selected tab when closing the current selectedTab?
-Ken
Yes, when a tab is closed, it is just hidden. I believe this was so that UltraTabStripControls bound to data sources could support tab closing without the control having to update the data source.
Answered my own question...I rolled my own code. BTW: When a tab is closed it isn't really removed from the collection and that throws selecting off at times. If you select a tab that has been closed you just see a blank tab panel.
My code looks like this:
private void OnSelectedTabChanging(object sender, SelectedTabChangingEventArgs e) { UltraTabControl aTabControl = sender as UltraTabControl; if (aTabControl != null && aTabControl.SelectedTab != null) previousTabIndex = aTabControl.SelectedTab.Index; } private void OnTabClosing(object sender, TabClosingEventArgs e) { this.AccountTabControl.SelectedTab = this.AccountTabControl.Tabs[previousTabIndex]; } void OnTabClosed(object sender, TabClosedEventArgs e) { if(e.CloseReason == TabCloseReason.CloseButton) this.AccountTabControl.Tabs.Remove(e.Tab); }