Dinesh Upreti

I have a requirement to simulate reordring of tabs(along with controls in it) just as a user would do in excel sheet (user can reorder the sheets in a excel workbook while working on it using the tab kind of interface provided at the bottom of workbook). I tried to do it using tab control, but couldnot figure out how any pointers on this or any other control which would make it possible.

Thanks

Dinesh



Re: Windows Forms General Reordering tab control

New-Bee

All you need to do is to find the right event for you (in your case I suppose you should aim at something in DragDrop) and add something along the lines of the following:

TabPage TPTemp = this.TabControl1.TabPages[0];
this.TabControl1.TabPages[0] = this.TabControl1.TabPages[1];
this.TabControl1.TabPages[1] = TPTemp;
this.TabControl1.SelectTab(1);
this.TabControl1.SelectTab(0);


Hope this helped...





Re: Windows Forms General Reordering tab control

Mick Doherty

There's an example on codeproject:
http://www.codeproject.com/cs/miscctrl/draggabletabcontrol.asp

I have a variation of this on my site:
http://www.dotnetrix.co.uk/tabcontrols.html --> Reposition TabItems at Runtime.

TabControlEx supports it with a property change (2 actually, AllowDrop + AllowTabDrag):
http://www.dotnetrix.co.uk/controls.html





Re: Windows Forms General Reordering tab control

Dinesh Upreti

Thanks,

This is of great help.