-1

I made a winform for logging in on my C# project and I assigned the tab index for each object. The order has to be the following:

  • Text Box User
  • Text Box Password
  • Button OK
  • Button Cancel.

When I press the Tab key at runtime the order goes backwards. I did it also with the tab order but it happens the same. How can I change it?

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
Marialvy Martínez
  • 286
  • 2
  • 6
  • 19

2 Answers2

3

From TabIndex remarks:

A tab index can consist of any valid integer greater than or equal to zero, lower numbers being earlier in the tab order.

From your description of problem, it looks like you have tab indexes in descending order. I suggest you to use Tab Order view to set tab indexes by clicking on your controls in desired order as described in article How to: Set the Tab Order on Windows Forms

Final result should look like:

enter image description here

Sergey Berezovskiy
  • 232,247
  • 41
  • 429
  • 459
0

I found the problem:

I made all forms in my app in four languages: English, Dutch, French and German. I set the order in just the Dutch language. So there has to be kept in mind that for every language the user has to configure the tab order or the tab index. I did the changes in the other three languages and it works perfectly.

Marialvy Martínez
  • 286
  • 2
  • 6
  • 19
  • Wouldn't your needs have been better met with satellite resource assemblies? As it stands now, your code probably has logic to determine which dialog to show and repeated code within each dialog. – Brad Bruce Jan 06 '14 at 11:46
  • @BradBruce I use the resources assemblies, but that doesn't work with the tab functions, there I am a bit lost. – Marialvy Martínez Jan 06 '14 at 12:23