Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to easily reorder TabControl?

I have a TabControl which I have designed in the VS2005 designer that has about 7 tabs.

How can I easily switch the order of the tabs around?

I put one tab at the end in a rush, but now I want it somewhere in the middle.

like image 405
CJ7 Avatar asked Aug 17 '12 07:08

CJ7


2 Answers

In the properties of the tab control there's a TabPages collection. You should be able to shuffle them around in there. Just click the ellipses next to TabPages and a dialog will appear allowing you to move each one up or down in the order.

like image 100
Paul Michaels Avatar answered Oct 14 '22 23:10

Paul Michaels


Mark the TabControl in the Designer.

In the Properties Window (F4) you have a TabPages Property. You can open a new Window where you can reorder the TabPages.

If you want to do that at runtime you have to do

tabControl.TabPages.Remove(tabPage1);
tabControl.TabPages.Add(tabPage1); // add to the end
tabControl.TabPages.Insert(2, tabPage1); // add on specific position
like image 22
Jürgen Steinblock Avatar answered Oct 14 '22 23:10

Jürgen Steinblock