Question

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?

Was it helpful?

Solution 2

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top