שתף באמצעות


How to change order of textboxes in textbox series ? (When using Tab key)

Question

Saturday, March 10, 2012 8:48 AM

I had problem with one textbox (texbox were third in row but while you used TAB it were as last), so I recreated all buttons in right order, but now it is totally wrong, when I click TAB it goes to first textbox, again TAB and it goes to 7th in ROW !!! instead to second in row :/ Weird thing is that I created all those textbox in row so 1 text box -> 2nd textbox etc. so I thought TAB will just go in order of creation, but it's not :/

How can I rearrange order of focus on text boxes while you using TAB ?? All those txt boxes has Tab Index = 23...

All replies (6)

Saturday, March 10, 2012 10:44 PM ✅Answered

Hi Mike,

Yes I know what you mean and I gave you the answer.. so you have a windows form application that has several textbox and combobox controls.. when you hit the Tab key (keyboard) in run mode the focus (tab order) is going not in correct way.. I understood very good :)

But you not me :D

You can change the 'order of focus' (called tab order) when pressing tab key on keyboard through that icon or via menu from Visual Studio.. you first have to open that form in design mode, then go to the menu View in Visual studio and choose 'Tab Order'... then you have to click from the first control that should have the tab order 1.. through the last control that the order of tab should pass :)

so in short, View>TabOrder, click controls to change the order and that's it :D

Hope you understand and it helps

Regards Muli

If some code doesn't work, don't worry help is on the way.. don't forget to mark your thread as solved when done...

Exactly.

@Mike--\>

You can change it in code as I suggested or use the "graphical way" as elucidated on by Muli. In Visual Studio, look for this:

Then click the controls in the order that you want them set to "tab" to. Actually both what Muli suggested and what I suggested end up being the same thing - they both change the .TabIndex, that's all. The "Tab Order" that you're referring to is just the .TabIndex list, sorted ascending.

Make sense?


Saturday, March 10, 2012 9:08 AM

Hi Mike,

Please use the TabOrderIcon on the 'Layout' toolStrip menu, then you have just to click on each control to assign the tab order..

for more help read this: Tab Order

Hope it helps :)

If some code doesn't work, don't worry help is on the way.. don't forget to mark your thread as solved when done...


Saturday, March 10, 2012 3:05 PM

To add to what Muli said, you can also just set it in code (in the form's load event) like:

TextBox1.TabIndex = 0
TextBox2.TabIndex = 1

etc..


Saturday, March 10, 2012 6:21 PM

Hi Mike,

Please use the TabOrderIcon on the 'Layout' toolStrip menu, then you have just to click on each control to assign the tab order..

for more help read this: Tab Order

Hope it helps :)

If some code doesn't work, don't worry help is on the way.. don't forget to mark your thread as solved when done...

I mean "Tab" key on keyboard :) not tab in VB.NET, when you click TAB on keyboard it is going in appropriate order through textboxes or combo boxes etc., I can't find how that order is set as I create all those text.box in order and now everything is totally different 


Saturday, March 10, 2012 7:27 PM

Hi Mike,

Yes I know what you mean and I gave you the answer.. so you have a windows form application that has several textbox and combobox controls.. when you hit the Tab key (keyboard) in run mode the focus (tab order) is going not in correct way.. I understood very good :)

But you not me :D

You can change the 'order of focus' (called tab order) when pressing tab key on keyboard through that icon or via menu from Visual Studio.. you first have to open that form in design mode, then go to the menu View in Visual studio and choose 'Tab Order'... then you have to click from the first control that should have the tab order 1.. through the last control that the order of tab should pass :)

so in short, View>TabOrder, click controls to change the order and that's it :D

Hope you understand and it helps

Regards Muli

If some code doesn't work, don't worry help is on the way.. don't forget to mark your thread as solved when done...


Sunday, March 11, 2012 10:02 AM

Thanks ! My bad, I was confused as all my texbox field has same tab index :)