Well I've search a lot, and can't find help anywhere.
I have a form with tabs. When I click a button, a new tab is added, and a usercontrol is added to the new tab.
I cannot figure out how to access the controls on the second + tabs. I can access the user controls just fine from the first tab.. just not the others.
Here is the code I had so far.
private void button1_Click(object sender, EventArgs e)
{
string title = "tabPage " + (tabControl1.TabCount + 1).ToString();
TabPage newPage = new TabPage(title);
tabControl1.TabPages.Add(newPage);
UserControl1 newTabControl = new UserControl1();
newPage.Controls.Add(newTabControl);
}
private void button2_Click(object sender, EventArgs e)
{
label1.Text = userControl1.textBox1.Text;
}
So when I click button one, say 2 or 3 times, and how do I get the text from the textBox in the userControl from that tab?
...maybe I'm going about it all wrong?