tabcontrol in winforms

In winforms C# VS2005
I need an advise of UI:
I want to have a tabcontrol with 2 tabs but I don't want the first tab to be chosen by default.
I want at the beginning that everything will be empty and only on press the first tab to see its page.
HOw can I do it.
Who is Participating?
ANAT2403Author Commented:
Hi JimBrandley,
There is no option of visible for the tabPages of the tabcontrol.
But I found the solution for the problem:
If I write
 tabCtrlLinking.SelectedIndex = -1 in the form load so no tab is selected and now if I select a tab
it will show this tab!
I have tried some things (setting SelectedTab = null or SelectedTabIndex = -1) but this woulnd work. The only way I see:
Remove all controls from the first tab at the constructor like
        Control[] mControls;

        public Form1()
            mControls = new Control[tabPage1.Controls.Count];

and add them again at the first MouseClick

private void tabControl1_MouseClick(object sender, MouseEventArgs e)
            if (tabPage1.Controls.Count == 0)
A method that might be easier is to simply hide them. xxx.Visible = false; Then reset them when the tab is selected.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.