INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Controls

Work-a-round for shifting TabPages on Windows form Tab control by SBendBuckeye
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 FAQ Index
Back to Visual Basic (Microsoft) VB.NET Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close