in

Platinum Bay

Peace, Love, and...

This Blog

Syndication


.NETicated

WinForms: Tab Order

So you've created a great winforms app with loads of controls, you fire it up, start tabbing through fields, and the cursor is jumping all over the place. What a pain. Now you have to go back through each and every control and set the tab order manually in the Properties window. Sound familiar?

In a stroke of pure genius, Microsoft thought of this too. Visual Studio contains built-in support for graphically setting control tab order – no more properties window.

To begin, load up your form in the designer view. The go to View >> Tab Order.

Your form should now have little blue boxes with white numbers over each control. Now you can simply start clicking through the blue boxes to set the tab order. As you set each item, the blue boxes will turn white and display the new tab order. When you have clicked through all the controls, the boxes turn blue again. If you screwed up, you can click through again.

Click through to View >> Tab Order again to exit this feature.

Comments

July 28, 2008 8:10 AM

Does this works just for VS 2008?

My project is in 2005 and I can't find that item in the menu.

Antonio
 

July 28, 2008 8:49 AM

Oh, just got it! I have to select the form, not any other control. Once the form is selected the tab order item in the menu appears.

Now I just have to figure it out how does it really works (4.5.15.1 is not a very intuitive tab order, and less if the next control says 4.5.6)

Antonio
 

February 6, 2009 2:14 AM

Damn it,So stupid.*** you!

 

May 18, 2009 9:43 AM

Great article - clear and concise.

 

September 21, 2010 10:31 AM

Insane. That is all I can say.

In Delphi, you simply chucked in a new control, figured where it belonged in the taborder, went to the taborder property and keyed in the new number. Done.

In VS, you can't, because you end up with two controls (or more!) having the same TabIndex.

Considering how the WinForms form designer came several years after Delphi's form designer, you would assume they would have solved this in a way that does not require the user to click himself to death.

Grrrrrrr.

Rune
 

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews is an independent consultant, INETA speaker, and Microsoft MVP for Visual Studio ALM. He has been working in technology for over ten years focusing on custom application development and Application Lifecycle Management. Steve is also Microsoft and IBM certified and a community fanatic having led sessions at nearly 100 events across North America. When he's not developing software solutions or engaging with the community about software technology, Steve is a closet singer and songwriter and plays the guitar and keys. Occasionally, Steve even gets to sleep. Occasionally.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.