Reputation: 291
I'm working with Windows Forms and put a Tab Control into my Form. I have already put some Buttons etc into the first tab and some other code. The problem that I have is the following:
I want to insert a Tab on the first place of the Tab Control but everytime I insert a new Tab he puts it at the end. How can I move the Tab without changing my code? I'm wondering because he made functions like
private void tabPage1_Click(object sender, EventArgs e)
{
}
but my code is beyond this function and I can't even insert it into it.
Upvotes: 1
Views: 3060
Reputation: 35646
TabControl has collection property TabPages
if you open editor of this property in winforms designer, you will see buttons with arrow up and arrow down in the central part of editor form
click them to change the order of tab pages
Upvotes: 3
Reputation: 1973
Use insert function for 0 index.
tabControl1.TabPages.Insert(0, "newTab");
Upvotes: 4