Hi, I would like to get some code for closing a tab outside my form-the concept is that when I click close a dialogue comes up saying close all, or just this tab- I have sorted out close all, but not close tab- but I have some code for closing a tab inside the main form,
private void deleteTabToolStripMenuItem_Click(object sender, EventArgs e)
{
if (current_tab_count < 2) return;
TabPage current_tab = tabControl2.SelectedTab;
WebBrowser thiswebpage = (WebBrowser)webpages[tabpages.IndexOf(current_tab)];
tabpages.Remove(current_tab);
tabControl2.TabPages.Remove(current_tab);
current_tab_count--;
}
I run C# 2010/.NET 4. So, could anyone help me? I've got a deadline.
I'm sorry, that's not what I'm looking for!
I want to be able to close a tab on my main form outside it- on a different form!
There will be a form- a new one that says close all or just this tab, i want to be able to make the just this tab button close just that tab that was open on a different form-I already have the code to delete a file, but need to know how to make it control a different form.