Control.TabIndex Property

Definition

Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key.

C#
[System.ComponentModel.Bindable(true)]
public int TabIndex { get; set; }

Property Value

A value that determines the order of logical navigation for a device. The default value is Int32.MaxValue.

Attributes

Examples

The following example sets the tab index of three buttons.

XAML

<Button Name="btn9" BorderThickness="5.0" 
        Click="ChangeBorderThickness" TabIndex="2">
  BorderThickness
</Button>

<Button Name="btn10" FontStretch ="Condensed" 
        Click="ChangeFontStretch" TabIndex="3">
  FontStretch
</Button>

<Button Name="btn11" Padding = "5" 
        Click="ChangePadding" TabIndex="1">
  Padding
</Button>

Remarks

A control with a lower tab index receives focus before a control with a higher index.

Dependency Property Information

Item Value
Identifier field TabIndexProperty
Metadata properties set to true None

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9