how to specify sequence of textbox when tab is pressed?

qadeer37

Well-known member
Joined
May 1, 2010
Messages
63
Location
Hyderabad,pakistan
Programming Experience
1-3
I have added 6 textbox controls now I want specify the order in which they are accessed when tab is pressed like txtbox1 then it goes to txtbox2 and so on.:D
 
You can set the TabIndex property of a control in the Properties window if you like. Just noet that that is its index within its container though, so if you have controls in Panels and GroupBoxes then it doesn't give the full picture.

I find that the best way is to set the TabIndex for every control visually. You can select View -> Tab Order from the main menu or click the corresponding button on the tool bar. That will display the TabIndex of each control in the designer. You can then click each control in the order you want them to tab in. When you're done, press the Escape key or click the tool bar button again. Simple.
 
As I said, you can enter the TabIndex directly into the Properties window, in which case you can use the keyboard, but it's easy to mess up if you have multiple containers. It's far less error-prone to do it visually. Nothing confusing about clicking the controls in the same order you want them to tab in I would hope.

Note also that you don't always have to click every control either. If you only want to swap the first two, you can simply click the first two and then escape. If you only want to swap the last two, just click the second-last one repeatedly until it shows the index you want, then click the last one and then escape.
 
Thanks it worked but it is a bit confusing as I was not able to enter the index number via key keyboard

Every time you click on the control it changes the tab index. You dont use the keyboard, you repeatedly click on controls with the mouse
 
Back
Top