API:Vcl.ComCtrls.TTabControl.TabOrder

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property TabOrder: TTabOrder read GetTabOrder write SetTabOrder default -1;

C++

__property TabOrder = {default=-1};

Properties

Type Visibility Source Unit Parent
property published
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TTabControl

Description

Indicates the position of the control in its parent's tab order.

Vcl.ComCtrls.TTabControl.TabOrder inherits from Vcl.Controls.TWinControl.TabOrder. All content below this line refers to Vcl.Controls.TWinControl.TabOrder.

Indicates the position of the control in its parent's tab order.

TabOrder is the order in which child windows are visited when the user presses the Tab key. The control with the TabOrder value of 0 is the control that has the focus when the form first appears.

Initially, the tab order is always the order in which the controls were added to the form. The first control added to the form has a TabOrder value of 0, the second is 1, the third is 2, and so on. Change this by changing the TabOrder property.

Each control has a unique tab-order value within its parent. If you change the TabOrder property value of one control to be the same as the value of a second control, the TabOrder value for all the other controls changes. For example, suppose a control is sixth in the tab order. If you change the control's TabOrder property value to 3 (making the control fourth in the tab order), the control that was originally fourth in the tab order now becomes fifth, and the control that was fifth becomes sixth.

Assigning TabOrder a value greater than the number of controls contained in the parent control moves the control to the end of the tab order. The control does not take on the assigned value of TabOrder, but instead is given the number that assures the control is the last in the tab order.

Note: TabOrder is meaningful only if the TabStop property is True and if the control has a parent. (The TabOrder property of a form is not used unless the form is the child of another form.) A control with a TabOrder of -1 has no parent, and therefore cannot be reached by pressing the Tab key. To remove a parented control from the Tab order, set its TabStop property to False.

See Also