简体   繁体   中英

Winforms insert Tab into Tab Control at right place

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.

对0索引使用插入功能。

tabControl1.TabPages.Insert(0, "newTab");

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

您可以使用此:

myTabCtrl.TabPages.Insert(0, "newTab");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM