The C1Tab Control > C1Tab Advanced Topics > Editing the Order of the Tabs |
The C1Tab tutorial described how to create tabs from scratch. But what if you want to add tabs after design, or to change the tab order for an existing Tab control? There is an easy way to do that.
Say you want to change our three-tab tutorial application by adding a new tab between the first and second tabs. The first thing you need to do is add the new tab. You can create the new tab using the Tabs property page or by changing the Caption property to the following string:
Example Title |
Copy Code
|
---|---|
Visual &Basic|Add-&Ins|Visual &C++|&ActiveX Controls |
Next, stretch the control horizontally so all tabs are visible. The C1Tab control supports automatic tab scrolling and multiple tab rows, but for now it will be easier to work if all tabs are visible.
The new tab, Add-Ins, has been created but it does not yet have a page attached to it. To fix this, activate the last tab using the mouse or the Properties Window. Because there is a page missing, the "Place Container Control Here" message will appear when you select the last tab. Create the new page.
Now you have the right number of pages, but they are in the wrong order. This is the interesting part.
Set the CurrTab property to -1, either using the Properties Window or clicking the tab that is already current. This will tile all pages within the Tab control so they all become visible. Setting the CurrPage property to -1 means "show all pages at once."
Now that you can see all pages in order, click on the last page (the one you just created) and drag it to its proper position (right after the first page). The Tab control will tile all pages again so they remain organized.
The picture below shows how to do this:
You can keep dragging pages around until you get the page order you want. When you are happy with the order, activate the first tab again, using the mouse or the Properties Window.
Everything is back to normal, and the tab order is now correct.