INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • Turn Off Ad Banners
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

E-mail*
Handle

Password
Verify P'word
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...I have tons of books, have book marked tons of tutorials, which have helped, but this forum has answered those "impossible to find" solutions. I am thrilled with this site..."

Geography

Where in the world do Tek-Tips members come from?

Visual Basic(Microsoft) -VB.NET 2002-2008 FAQ

Controls

Work-a-round for shifting TabPages on Windows form Tab control
Posted: 2 Aug 05 (Edited 2 Aug 05)

When you use a Tab control in a .Net Windows form and then change the TabPage order using the items property, it does not always display properly. This is a known and documented bug which has not been fixed.

I ran into it recently and found a handful of solutions, the best of which seemed to be adding the TabPages into the Tab's controls array manually when the form loaded:

CODE

'Assumes a tab control named tc and 4 TabPages
tc.Controls(0) = tabPage0
tc.Controls(1) = tabPage1
tc.Controls(2) = tabPage2
tc.Controls(3) = tabPage3
I set the index value in the Tag property and then ensured the correct order by doing something like this:

CODE

Dim index As Integer
For Each tp As TabPage In Me.tc.TabPages
    index = CInt(tp.Tag)
    Me.tc.TabPages(index) = tp
Next  
Enjoy!

Back to Visual Basic(Microsoft) -VB.NET 2002-2008 FAQ Index
Back to Visual Basic(Microsoft) -VB.NET 2002-2008 Forum
My FAQ Archive
Email This FAQ To A Friend

My Archive