Setting the Tab Order
The tab order is the order in which a user moves from one control to another by pressing the TAB key. Each form has its own tab order. Usually, the tab order is the same as the order in which you created the controls.
For example, assume you create two text boxes, Text1 and Text2, and then a command button, Command1. When the application starts, Text1 has the focus. Pressing TAB moves the focus between controls in the order they were created.
To change the tab order for a control, set the TabId property. The TabId property of a control determines where it is positioned in the tab order. By default, the first control drawn has a TabId value of 10, the second has a TabIndex of 20, and so on.
Note that controls that cannot get the focus, as well as disabled and invisible controls, don't have a TabId property and are not included in the tab order. As a user presses the TAB key, these controls are skipped.
Removing a Control from the Tab Order
Usually, pressing TAB at run time selects each control in the tab order. You can remove a control from the tab order by setting its TabId property to (0).
A control whose TabId property has been set to zero still maintains its position in the actual tab order, even though the control is skipped when you cycle through the controls with the TAB key.
![]() |