Share via


Changing the Tab Order of Controls

The tab order is the order in which the TAB key moves the input focus from one control to the next within a dialog box. Usually the tab order proceeds from left to right and from top to bottom in a dialog box. Each control has a Tabstop property that determines whether a control receives input focus.

To set input focus for a control

Even controls that do not have the Tabstop property set to True need to be part of the tab order. This can be important, for example, when you define access keys (mnemonics) for controls that do not have captions. Static text that contains an access key for a related control must immediately precede the related control in the tab order.

Note

If your dialog box contains overlapping controls, changing the tab order may change the way the controls are displayed. Controls that come later in the tab order are always displayed on top of any overlapping controls that precede them in the tab order.

To view the current tab order for all controls in a dialog box

  • On the Format menu, click Tab Order.

- or -

  • Press CTRL + D.

To change the tab order for all controls in a dialog box

  1. On the Format menu, click Tab Order.

    A number in the upper-left corner of each control shows its place in the current tab order.

  2. Set the tab order by clicking each control in the order you want the TAB key to follow.

  3. Press ENTER to exit Tab Order mode.

    Tip

    Once you enter Tab Order mode, you can press ESC or ENTER to disable the ability to change the tab order.

To change the tab order for two or more controls

  1. From the Format menu, choose Tab Order.

  2. Specify where the change in order will begin. To do this, hold down the CTRL key and click the control prior to the one where you want the changed order to begin.

    For example, if you want to change the order of controls 7 through 9, hold down CTRL, then select control 6 first.

    Note

    To set a specific control to number 1 (first in the tab order), double-click the control.

  3. Release the CTRL key, then click the controls in the order you want the TAB key to follow from that point.

  4. Press ENTER to exit Tab Order mode.

For information on adding resources to managed projects, please see Resources in Applications in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resources strings to properties, see Walkthrough: Localizing Windows Forms and Walkthrough: Using Resources for Localization with ASP.NET.

Requirements

Win32

See Also

Concepts

Controls (MFC)

Reference

The Arrangement of Controls on Dialog Boxes

Controls in Dialog Boxes