0

Greetings all

I've done some research and its apparently impossible to hide a tab on a tabcontrol, I need to save one to a tab page variable and recreate it. I know how to add a tab from a TabPage variable

TabControl.Controls.Add(tab1);

However I have no idea how to save the tab into the variable in the first place! I would presume it is something like this:

TabPage tab1 = TabControl.TabPages("CaseDetails");

It's not having any of that though, any ideas?

Regards

Dan

3
Contributors
2
Replies
5
Views
6 Years
Discussion Span
Last Post by Victor_8
0

In case any one reads this EVER, here's what I did, and it seems to work

//Global variable
Tabpage tab1, tab2, tab3;

private void Form1_Load(object sender, EventArgs e)
{
    tab1 = tabPage1;
    tab2 = tabPage2;
    tab3 = tabPage3;
}

//Button on page 1.
private void button1_Click(object sender, EventArgs e)
{
    tabControl1.TabPages.Clear();
    tabControl1.Controls.Add(tab2);
    tabControl1.Controls.Add(tab3);
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.