Design Pattern Library 1.5

General Guidelines

Desktop/Web

Mobile (Tablet & Phone)

Visual Design Guidelines

Forms - Tab Indexes

Problem

The user would like to quickly navigate controls within a view without having to manually move and click the mouse.

Solution

Provide a logical path through the view controls that is accessible through the use of the tab key.

Why

Each control on a form is assigned a unique, identifying number. A control's TabIndex determines the order in which that control will receive focus and become active. Pressing the Tab key cycles the user through the controls on a form, enabling the user to quickly and more efficiently accomplish their task. Pressing Shift+Tab cycles in the opposite direction.

How

When the user moves to another control, this makes it the active Control - the one with the focus, the one capable of reacting to something the user types on the keyboard. Of three TextBoxes on a window, only one has the focus at any given time and can thus display what the user types.

The user can move to any of the controls on a form by pressing the Tab key, which is an alternative to using the mouse to click on a Control, and make it active.

There are two exceptions to the rules involving TabIndex:

  • Frames and Labels cannot receive focus although they do have a TabIndex Property. Frames and Labels will nonetheless be ignored when the user presses the Tab key to move among the objects on a form.
  • Any control that is disabled or invisible will also be skipped during user tabbing.
  • If there are three TextBoxes on a window, pressing the Tab key moves you from the first, to the second, to the third, and back to the first, and so on. Which TextBox is "first," "second" or "third" is determined by its TabIndex number. Pressing Tab cycles through the Controls on the window. The order in which the user moves through the Controls on a window is also determined by their TabIndex Properties.

There may be occassions where changing the the TabIndex property may be desirable. You might want to adjust the TabIndex so that pressing the Tab key cycles more intelligently through related controls.