I'm new here. i got a little problem with tab controlling.here is the problem...
I've added a new tab control with 3 tabs to my form. i want to hide tabpage2 on default view so I wrote tabpage2.dispose() method in formload event.
now I want to view that page by clicking a button placed in tabpage1.(tabpage1 is the default view) so i wrote,
1. tabpage2.show();
2. tabcontrol.selectedtab = tabpage2;
3. tabpage2.select();
but I couldn't get that tabpage again.

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Mar 9, 2011, 3:34 AM EST
I am not sure but telling you. Instead of using Dispose() use Hide() as like Show().
Ramesh7 reputationPosted Mar 9, 2011, 3:37 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Mar 9, 2011, 6:53 PM EST
But probably what you need to do is to add and remove tabpages from the ControlCollection' the collection of tabpages.
Suthish NairRank #92 · 22.8K reputationPosted Mar 10, 2011, 9:10 AM EST
tabcontrol.Tabs[1]. Visible = false;
Ramesh7 reputationPosted Mar 11, 2011, 9:12 AM EST
public partial class Form1 : Form { TabPage t1; private void Form1_Load(object sender, EventArgs e) { t1 = tabControl1.TabPages[1]; tabControl1.TabPages.RemoveAt(1); } private void button1_Click(object sender, EventArgs e) { tabControl1.TabPages.Insert(1, t1); } } // I GOT THIS ANSWER FROM A CODEPROJECT MEMBER. AND IT'S WORKING..!!!Sam HobbsRank #107 · 20.5K reputationPosted Mar 11, 2011, 9:56 AM EST
Ramesh7 reputationPosted Mar 12, 2011, 1:43 AM EST