Your problem, I guess, was, that
.Hide()
and
.Visible = false
didn't work out as assumed...
You have to remove it from the
TabPages
of your control... something like this
if (this.tabControl1.TabPages.Contains(this.tabPage2))
this.tabControl1.TabPages.Remove(this.tabPage2);
else
this.tabControl1.TabPages.Add(this.tabPage2);
Remember, this is just a hint... don't just copy&paste it...