Vcl.WinXCtrls.TCustomRelativePanel.SetControlIndex

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetControlIndex(AControl: TControl; Index: Integer);

C++

void __fastcall SetControlIndex(Vcl::Controls::TControl* AControl, int Index);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.WinXCtrls.pas
Vcl.WinXCtrls.hpp
Vcl.WinXCtrls TCustomRelativePanel

Description

Sets the index of the specified AControl as the Index in the ControlCollection.

The index of a control in the ControlCollection affects the precendence in the alignment process.

When you change the index of a control, the rest of the control on the relative panel adjust their index accordingly. For example:

You have 3 controls on your relative panel with the following index values:

  • Button1: Index is 0.
  • Edit1: Index is 1.
  • Shape1: Index is 2.

If you execute the following code:

Delphi:

RelativePanel1.SetControlIndex(Shape1,0);

C++:

RelativePanel1->SetControlIndex(Shape1,0);

The index of the 3 controls on your relative panel becomes:

  • Button1: Index is 1.
  • Edit1: Index is 2.
  • Shape1: Index is 0.

See Also