private void mainControl_OnClose(object sender, CloseEventArgs e) { TabPage tab = this.mainControl.TabPages[e.TabIndex]; if (this.mainControl.TabPages.Count > 1) { SessionController.RemoveJobFromSession(tab.Text); this.mainControl.Controls.Remove(tab); } else { Environment.Exit(0); } }
private void userControl11_OnClose(object sender, CloseEventArgs e) { this.userControl11.Controls.Remove(this.userControl11.TabPages[e.TabIndex ]); }
private void userControl11_OnClose(object sender, CloseEventArgs e) { this.userControl11.Controls.Remove(this.userControl11.TabPages[e.TabIndex]); tabs--; if (tabs == 0) { //Copy and add LastTabPage CharTabPage tabPage; tabPage = LastTabPage; tabs++; tabPage.Location = new System.Drawing.Point(4, 28); tabPage.Menu = this.contextMenuStrip1; tabPage.Name = "New Group " + tabs; tabPage.Size = new System.Drawing.Size(816, 288); tabPage.TabIndex = tabs; tabPage.Text = "New Group " + tabs; this.userControl11.Controls.Add(tabPage); } }