From RAD Studio API Documentation
Jump to: navigation, search


property Margins: TBounds read GetMargins write SetMargins;


__property Fmx::Types::TBounds* Margins = {read=GetMargins, write=SetMargins};


Type Visibility Source Unit Parent
property public
FMX.Controls TControl


Aligns the component to the margins points of other components.

The Margins of a control are the distances (in pixels) from each edge (top, left, bottom, right) to another control within the same Parent or to the edge of its Parent. The Margins add space to the outer side of the control. It only applies for controls that do not use TAlignLayout None and the components are located to each other.

If a margin is not 0, no other control will come closer to the control than the specified distance. If the distance from a Parent edge to the corresponding control edge is smaller than the specified Margins for that edge, the control is repositioned and resized, if necessary, to maintain the specified distance.

If the Margins control has zero values, RAD Studio uses the default values (Left=4, Top=4, Right=4, Bottom=4). You can also set your own Margins values. It only applies to the IDE control's guidelines, when you are dragging control. But if you use Align=Client (for example), it will use the specified values in Margins.

The following image shows how Padding and Margins properties affect alignment, position, and size of controls.

Margins Padding Control.png

See Also