TabPage order change

hog

Senior Contributor
Joined
Mar 17, 2003
Messages
984
Location
UK
I messed about changing the view of my TabControl so that the tabs appeared as buttons. On doing this TabPage 12 now appears next to Tabpage 1 then 2 follows.

This has not happened before no matter how many times I opened the form

I have read the section in the Windows Forms FAQ referred to by Divil which says to delete them then recreate them on form startup!

Anyone got a better idea??
 
You can go to the InitializeComponent function and look for the line "TabControl.AddRange" where TabControl is the name of your tab control. You should see a comma-separated list of the TabPages, just move them around there.

You can also use the Designer. Get the TabControl in the properties window, then click on the ... button next to the TabPages property. In the dialog popup, you can use the up/down arrows to move TabPages around.

This happens from time to time. I can't reproduce it regularly, but I've seen it happen a few times.

-Ner
 
Back
Top