I have a bunch of buttons on a form and when the person presses TAB I want the focus of the controls move in a specific order. Does anyone know how to do this?
Tab order can be set in the Properties window of the designer using the TabIndex property. The TabIndex property of a control determines where it's positioned in the tab order. By default, the first control added to the designer has a TabIndex value of 0, the second has a TabIndex of 1, and so on.
You can change the tab order of the controls by pressing View > Tab Order). You can also right click the dialog box and choose Tab Order from the shortcut menu. In either case the Tab Order dialog box is displayed. To move a control select it and click the arrow keys either up or down.
Control tab order is determined by the order in which controls are drawn on the screen. The first control that you draw is assigned a tab order of 1 , the next is given tab order number 2 , and so on.
If you have form with lots of control then manage tab index by below method:
Example:
Then just click on controls one by one in order that you want to set tab order.
You can do this in the Designer as well, see Setting the TabIndex property of many form controls in Visual Studio?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With