/// <summary>User is closing a tab.</summary> private void OnCloseTabClick2(object sender, EventArgs e) { TabEventArgs args = new TabEventArgs(); args.LeftTabControl = false; if (TabClosing != null) { args.Name = tabControl2.SelectedTab.Text; args.Index = tabControl2.SelectedIndex; TabClosing.Invoke(this, args); } if (tabControl2.SelectedTab.Text != indexTabText) { tabControl2.TabPages.Remove(tabControl2.SelectedTab); } }
/// <summary>User is closing a tab.</summary> private void OnCloseTabClick2(object sender, EventArgs e) { TabEventArgs args = new TabEventArgs(); args.LeftTabControl = false; if (TabClosing != null) { args.Name = tabControl2.SelectedTab.Text; args.Index = tabControl2.SelectedIndex; TabClosing.Invoke(this, args); } if (tabControl2.SelectedTab.Text != indexTabText) tabControl2.TabPages.Remove(tabControl2.SelectedTab); }