[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TControlBorderSpacing

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TControlBorderSpacing - the spacing around a Control

## Declaration

Source position: controls.pp line 645

`type TControlBorderSpacing = class(TPersistent)`
`protected`
`procedure Change(); virtual;` |  | Change - software emulation of the OnChange event
`public`
`constructor Create();` |  | Create - constructor for TControlBorderSpacing: sets some default positions, dimensions and alignments, then performs inherited Create
`procedure Assign(); override;` |  | Assign the contents of Source to the current control. If it is of the same type, copies selected spacing properties, otherwise calls inherited Assign
`procedure AssignTo(); override;` |  | AssignTo - calls the Assign procedure for the Destination control
`function IsEqual();` |  | IsEqual - returns True if the specified spacing equals the current value
`procedure GetSpaceAround();` |  | GetSpaceAround - finds the space around the edge
`function GetSpace();` |  | GetSpace - finds the space required by the specified Anchor kind
`function GetSideSpace();` |  | GetSideSpace - finds th espace requied at the side for the specified anchor kind
`property Control: TControl; [r]` |  | The control for which border spacing is defined
`property Space: Integer; [rw]` |  | The kind of anchor to used in calculating spacing
`published`
`property OnChange: TNotifyEvent; [rw]` |  | Event handler for a change in border spacing
`property Left: TSpacingSize; [rws]` |  | The size of the space at the left border
`property Top: TSpacingSize; [rws]` |  | The size of the space at the top border
`property Right: TSpacingSize; [rws]` |  | The size of the space at the right border
`property Bottom: TSpacingSize; [rws]` |  | The size of the space at the bottom border
`property Around: TSpacingSize; [rws]` |  | The size of the space all around the control
`property InnerBorder: Integer; [rws]` |  | Amount of pixel added to the widgetset's preferred size
`property CellAlignHorizontal: TControlCellAlign; [rw]` |  | CellAlignHorizontal - the sort of horizontal alignment to use if a cell is being aligned
`property CellAlignVertical: TControlCellAlign; [rw]` |  | CellAlignVertical - the sort of vertical alignment to use if a cell is being aligned
`end;`

## Inheritance

`TControlBorderSpacing` |  | TControlBorderSpacing - the spacing around a Control
`TPersistent`
`TObject`

## Description

    { TControlBorderSpacing defines the spacing around a control.

        The spacing around its children and between its children is defined in
        TWinControl.ChildSizing.

        Left, Top, Right, Bottom: integer;
            minimum space left to the autosized control.
            For example: Control A lies left of control B.
            A has borderspacing Right=10 and B has borderspacing Left=5.
            Then A and B will have a minimum space of 10 between.

        Around: integer;
            same as Left, Top, Right and Bottom all at once. This will be added to
            the effective Left, Top, Right and Bottom.
            Example: Left=3 and Around=5 results in a minimum spacing to the left
            of 8.

        InnerBorder: integer;
            This is added to the preferred size.
            For example: A buttons widget returns 75x25 on GetPreferredSize.
            CalculatePreferredSize adds 2 times the InnerBorder to the width and
            height.

        CellAlignHorizontal, CellAlignVertical: TControlCellAlign;
            Used for example when the Parents.ChildSizing.Layout defines a table
            layout.

      }

The latest version of this document can be found at lazarus-ccr.sourceforge.net .