public virtual void UpdateTabSelection(bool updateFocus) { if (!this.IsHandleCreated || this.tabPanels == null) { return; } this.SuspendLayout(); this.lockChildIndexSet = true; this.SuspendStripNotifications(false, true); if (this.selectedIndex >= 0 && this.selectedIndex < this.tabPanels.Count) { TabPanel tabPanel = this.tabPanels[this.selectedIndex]; this.SetSelected(tabPanel); if (updateFocus && !tabPanel.ContainsFocus && !TabStripPanel.SuspendFocusChange) { tabPanel.SelectNextControl((Control)null, true, true, false, false); } } else { this.SelectTabItem((TabStripItem)null); } for (int index = 0; index < this.tabPanels.Count; ++index) { if (index != this.selectedIndex) { this.tabPanels[index].Visible = false; } } this.ResumeStripNotifications(false, true); this.lockChildIndexSet = false; this.ResumeLayout(true); }
protected internal virtual void UpdateTabSelection(bool updateFocus) { if (!this.IsHandleCreated || this.tabPanels == null) { return; } this.SuspendLayout(); this.lockChildIndexSet = true; this.SuspendStripNotifications(false, true); if (this.selectedIndex >= 0 && this.selectedIndex < this.tabPanels.Count) { TabPanel panel = this.tabPanels[this.selectedIndex]; this.SetSelected(panel); if (updateFocus && !panel.ContainsFocus) { panel.SelectNextControl(null, true, true, false, false); } } else { SelectTabItem(null); } for (int i = 0; i < this.tabPanels.Count; i++) { if (i != this.selectedIndex) { this.tabPanels[i].Visible = false; } } this.ResumeStripNotifications(false, true); this.lockChildIndexSet = false; this.ResumeLayout(); }