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

# TControlBorderSpacing

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

Describes the (minimum) spacing around a control.

## Declaration

Source position: controls.pp line 809

`type TControlBorderSpacing = class(TPersistent)`
`protected`
`procedure Change(); virtual;` |  | Invalidates the control and signals the OnChange event handler.
`function GetOwner; override;` |  | Gets the class where the border spacing values are used.
`public`
`constructor Create();` |  | Constructor for the class instance.
`procedure Assign(); override;` |  | Copies property values from the specified persistent object.
`procedure AssignTo(); override;` |  | Copies property value from the class instance to the specified persistent object.
`function IsEqual();` |  | True when the specified spacing is the same as the current settings in the class instance.
`procedure GetSpaceAround(); virtual;` |  | Returns the bounds with added Around space.
`function GetSideSpace();` |  | The space on a control side including Around space.
`function GetSpace(); virtual;` |  | Gets the value for the indexed Space property.
`procedure AutoAdjustLayout();` |  | Automatically adjusts the size of the control using the specified proportions.
`property Control: TControl; [r]` |  | The control where the border spacing values are applied.
`property Space []: Integer; [rw]` |  | Provides indexed access to the border spacing value for a given anchor side.
`property AroundLeft: Integer; [r]` |  | Total border spacing reserved using the Around and Left properties.
`property AroundTop: Integer; [r]` |  | Total border spacing reserved using the Around and Top properties.
`property AroundRight: Integer; [r]` |  | Total border spacing reserved using the Around and Right properties.
`property AroundBottom: Integer; [r]` |  | Total border spacing reserved using the Around and Bottom properties.
`property ControlLeft: Integer; [r]` |  | Position for the left-hand edge of the associated Control after it has been adjusted for border spacing.
`property ControlTop: Integer; [r]` |  | Position for the top edge of the associated Control after it has been adjusted for border spacing.
`property ControlWidth: Integer; [r]` |  | Total width for the control including border spacing values in Around, Left, and Right.
`property ControlHeight: Integer; [r]` |  | Total height for the control including border spacing values in Around, Top, and Bottom.
`property ControlRight: Integer; [r]` |  | Position for the right-hand edge of the associated Control after it has been adjusted for border spacing.
`property ControlBottom: Integer; [r]` |  | Position for the bottom of the associated Control including assigned border spacing.
`published`
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when border spacing value(s) have been changed.
`property Left: TSpacingSize; [rws]` |  | The border space on the left edge of the associated control.
`property Top: TSpacingSize; [rws]` |  | The border space on the top edge of the associated control.
`property Right: TSpacingSize; [rws]` |  | The border space on the right edge of the associated control.
`property Bottom: TSpacingSize; [rws]` |  | The border space on the bottom edge of the associated control.
`property Around: TSpacingSize; [rws]` |  | The border space on each of the edges for the associated control.
`property InnerBorder: Integer; [rws]` |  | Space added to the preferred size for the widget.
`property CellAlignHorizontal: TControlCellAlign; [rw]` |  | The horizontal alignment of the associated Control when the control ChildSizing uses a tabular layout.
`property CellAlignVertical: TControlCellAlign; [rw]` |  | The vertical alignment of the associated Control when the control ChildSizing uses a tabular layout.
`end;`

## Inheritance

`TControlBorderSpacing` |  | Describes the (minimum) spacing around a control.
`TPersistent`
?
`TObject`

## Description

TControlBorderSpacing defines the number of pixels reserved as spacing on the various borders for a control. TControlBorderSpacing is the type used to implement the BorderSpacing property in TControl.

Left, Top, Right, Bottom: Integer;
  Defines the space available to the auto-sized 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 but specified 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 Parent ChildSizing.Layout defines a table layout.

See TWinControl.ChildSizing and TControlChildSizing for information about spacing around and between child controls on a control instance.

## See also

TControlBorderSpacing.Around |  | The border space on each of the edges for the associated control.
TControlBorderSpacing.Bottom |  | The border space on the bottom edge of the associated control.
TControlBorderSpacing.InnerBorder |  | Space added to the preferred size for the widget.
TControlBorderSpacing.Left |  | The border space on the left edge of the associated control.
TControlBorderSpacing.Right |  | The border space on the right edge of the associated control.
TControlBorderSpacing.Top |  | The border space on the top edge of the associated control.
TControlBorderSpacing.CellAlignHorizontal |  | The horizontal alignment of the associated Control when the control ChildSizing uses a tabular layout.
TControlBorderSpacing.CellAlignVertical |  | The vertical alignment of the associated Control when the control ChildSizing uses a tabular layout.
TControl.BorderSpacing |  | Determines the inner and outer border spacing for this control.
TWinControl.ChildSizing |  | Provides a grid (table) layout for the children of this control.