FMX.Controls.TControl.Anchors

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

property Anchors: TAnchors read FAnchors write SetAnchors stored IsAnchorsStored nodefault;

C++

__property System::Uitypes::TAnchors Anchors = {read=FAnchors, write=SetAnchors, stored=IsAnchorsStored, nodefault};

Properties

Type Visibility Source Unit Parent
property public
FMX.Controls.pas
FMX.Controls.hpp
FMX.Controls TControl

Description

Specifies how the control is anchored to its parent.

Use Anchors to ensure that a control maintains its current position relative to the edges of its parent, even if the parent is resized. When its parent is resized, the control holds its position relative to the edges to which it is anchored. Anchors is enforced only when the parent control is resized.

If a control is anchored to opposite edges at the same time, the control stretches horizontally or vertically to maintain constant the distance between the control edges and parent edges. If a control is anchored to all four edges of its parent, the control stretches in all directions. By default, a control is anchored to the top and left edges of its container (Anchors=[akTop,akLeft]).

The automatic alignment may affect the anchors of a control. When Align is set to None, all the anchors are available. If Align is not None, the anchors affected by the automatic alignment are excluded. Changing the state of the anchors affected by the automatic alignment has no effect over the control.

Controls that have the Align or Anchors properties set can use a Scale that is different from the default (1,1), so that controls align together even when they have a custom scale.

See Also