I have a problem with a tabControl. I have a form that consists of MainForm with a tabControl on it. There is a TabPage called Main Menu that displays a UserControl called MainMenu. On MainMenu there are several buttons that should either add a new TabPage
to the tabControl on MainForm or display the TabPage if it already exists.
The tabControl on MainForm has its modifier set to public and MainForm is declared on MainMenu using:
MainForm MainForm = new MainForm();
I have the following code that works fine if the button and code are placed directly onto the TapPage, Main Menu.
public void TabButtons(object sender, EventArgs e)
Exists = false;
Button clickedButton = (Button)sender; //Get the name of the button that was clicked
TabName = clickedButton.Text; //Save the button text to use later
TabControl.TabPageCollection TabCollection = MainForm.tabControl.TabPages
View Complete Post