How do i get rid of the body in my tabControl? and how do i add and remove tabpages? I need to add/remove tabpages in code but hide the body in code or in the editor. I tried making the tabControl hight <20 but no matter what it has a line showing how wide it is.
+1
A:
What do you mean by "hide the body"? If you mean the "page" part of the tab, it's not really a tab page any more if you can only see the labels. What are you trying to accomplish? It may well be that a tab control isn't the best approach.
Jon Skeet
2009-04-07 22:25:53
I have a search and i would like to do multiple at once. I have one copy of controls that will hold the display info, all i need is a way for the user to switch between results he would like. Tab seems like a logic choose, except i dont need its body.
acidzombie24
2009-04-07 22:29:29
Sounds non-idiomatic to me. If I see tabs, I expect them to switch between tab pages. If it didn't actually change anything, I'd be surprised. Have you tried radio buttons?
Jon Skeet
2009-04-07 22:37:27
Thats a good idea. However it would seem awkward for radios to appear when creating a search. It wont feel like switching between result/page. But i know it would work.
acidzombie24
2009-04-07 22:43:01
+1
A:
You can create new tab pages in code and add them to the TabControl's Controls collection:
private System.Windows.Forms.TabPage tabPage1;
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabControl1.Controls.Add(this.tabPage1);
You can hide the tab control from code with this:
tabControl1.Hide();
Slidell4life
2009-04-07 22:26:41
Part one of my question thanks :)To bad i cant set multiple answer.
acidzombie24
2009-04-07 22:47:50
+2
A:
As far as I know, there's no built-in control for a row of tabs without pages for each tab.
You could just cover the body with a Panel. If you adjust the size of the panel carefully, it should look ok.
Blorgbeard
2009-04-07 22:37:30