Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Tab Moving

Am I blind or is it impossible to move a TabPage within a TabControl (eg. move a tab from position 5 to position 2), or control where a new TabPage is placed (eg. other than at the end), without Removing and Adding it from/to the Controls collection? Neither SetChildIndex nor BringToFront have any effect (I expected the former to but not the latter).

NetFreak
Thursday, September 23, 2004

Have you tried simply swapping the indices with the this[] property, aka the indexer, on the TabControl.TabPages collection?

Chris Nahr
Friday, September 24, 2004

Uhhh yeah.... I knew I had to be OTL.. just when I was getting ready to give up on JOS, a useful piece of feedback! Thanks.

NetFreak
Friday, September 24, 2004

I might be wrong but could this do the trick:

((IList)tabControl1.Controls).Insert(0, tabPage1);

/e

/e
Saturday, September 25, 2004

*  Recent Topics

*  Fog Creek Home