Monday, June 10, 2013

How to set the tab order for controls in a form, Microsoft Visual Studio 2010?

It might happen to you, as it happened to me to have a form with many controls. When you run the application and use only keyboard for moving from one control to another you notice that the order is random, in fact is according to the order of creation of your controls. Maybe you had to change the order after your first sketch.
My first tryout was to change the order manually. I choose from Properties the Tab Index and changed according to my plans. The problem was that I received a nice error that was saying( i don't remember exactly) that the index is already occupied, so it could not change order.

Finally, I searched a while around to see how to set the tab order index for many controls in a form of Microsoft Visual Studio. I found a nice and easy solution which tested and works for Windows Forms in Visual Studio 2010.

First step: as you are in Design View of your form in menu go to View and select Tab Order.


Second step: on your controls will appear a number that represents the Tab Order of your control. For re - setting tab order press a click in ascending order the controls that want to succeed, including Labels(even they are not selectable). I hope it is very intuitive this step for you too.You may see the image bellow.

When you have finished press Escape. Retest your application :)

Like and Share - very much appreciated ;)

No comments:

Post a Comment