Determining Control Tab Order

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. These tab order numbers correspond to the order in which controls appear in the Screen Section definition for the screen.

When a user presses the Tab key to move through the screen, tab order determines the default behavior for moving the cursor. Unless you have defined alternate behavior for the Tab key (or otherwise added special keystroke handling code), when the user presses Tab, the cursor moves to the next ACCEPT field on the screen.

As you cut, paste, and move controls around a screen form in the Screen Designer, you are likely to need to make adjustments to the controls' tab order. These changes can be made quickly and easily through the Reset Controls' Tab Order dialog box.

To view and adjust controls’ tab order, do the following:

  1. Select the Tab Order command from the Screen Designer right-click menu or the Align menu to open the Reset Controls’ Tab Order dialog. (You can also use the Ctrl+D keyboard shortcut.)

    The dialog box lists all of the controls on your screen in tab order, next to the tab order number.

    The tab order numbers also display on the screen design form.
  2. Change the tab order on your screen by selecting a control and using the up and down arrows.

    Note that changing the tab order also changes the order that controls appear in the Screen Section. In other words, the user tabs through controls on the screen in the order that those controls appear in the program’s Screen Section definition.

  3. You can also use the Send to Back and Send to Front commands in the Screen Designer right-click pop-up menu. Send to Back gives the selected control the lowest tab order number, reordering all other controls accordingly. Send to Front gives the selected control the highest tab order number. These controls are not enabled when more than one control is selected.

Note that if you create a frame and place controls inside that frame, the tab order within the frame exists exclusively of the controls outside of it. In this instance, you cannot create a tab order outside of a frame and continue it inside of the frame. The tab order inside of the frame starts at 1. You can, however, change the tab order within the frame itself. Tab order is continuous if you draw a frame around controls that already exist.