Re: Help with SelectedTab
Id create each tab with a tag, so tab one could have the tag 1 and tab two could have the tag 2 etc..
Then the following code would loop round the entire tab collection and then all of the control on the selected tab. If someone knows a better way, please correct me.
string tag = tabControl1.SelectedTab.Tag.ToString();
foreach (TabPage tab in tabControl1.TabPages)
{
if (tab.Tag.ToString() == tag)
{
foreach (Control ctrl in tab.Controls)
{
if (ctrl.GetType() == typeof(TextBox))
{
ctrl.Text = "Tab page updated!";
}
}
}
}