Web2py user
Web2py user

Reputation: 73

How can I make the order of components correctly in C# (Window Form application)?

I'm creating a program using C# and I have lots of textbox and buttons. The thing is when I type something into textbox and type 'tap' button, it goes to weird area. I mean, after I finish typing in the first textbox, I want to move to the second textbox using 'tap' button but it goes to third textbox (because I made third one before second one) Is there any way to fix this easily? or should I make them from scratch?

Thanks

Upvotes: 0

Views: 371

Answers (4)

Oded
Oded

Reputation: 499002

Each control has a TabIndex property.

Start with the first control in the tab order being 1 and increment it in the next control.

Upvotes: 1

Fredrik Mörk
Fredrik Mörk

Reputation: 158309

You will want to set the tab order of your controls. See How to: Set the Tab Order on Windows Forms for details on how to do that.

Upvotes: 0

Haris Hasan
Haris Hasan

Reputation: 30097

Yes you can use the TabIndex property for this purpose

Assign 0 to first Textbox
Assign 1 to 2nd Textbox
Assign 2 to 3rd Textbox
Assign 3 to 4th Textbox

and so on

When you press the Tab button focus goes to control with 0 tab index and then 1 and so on

Upvotes: 0

Felice Pollano
Felice Pollano

Reputation: 33252

In the designer you should see a "TabIndex" property, use this as a sequence to specifiy the tab order: when you press 'Tab' the focus pass to the item having the index immediately grether than the current.

Upvotes: 3

Related Questions