private void CloseTab(BrowserTab tab) { Tabs.TabPages.Remove(tab); tab.Dispose(); if (Tabs.TabPages.Count == 0) { AddTab("https://darkorbit.com"); } }
private void CloseTab(int index) { if (index >= 0) { BrowserTab bt = tabControl1.TabPages[index] as BrowserTab; if (bt != null) { foreach (BrowserScript bs in bt.Scripts) { bs.Stop(); } tabControl1.TabPages.RemoveAt(index); bt.Dispose(); } } button6.Enabled = tabControl1.TabPages.Count > 0; }