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

# TControlChildSizing

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

Provides settings to layout child-controls into a grid (table) layout.

## Declaration

Source position: controls.pp line 1952

`type TControlChildSizing = class(TPersistent)`
`protected`
`procedure Change; virtual;` |  | Notifies the Control of the child sizing changes and signals the OnChange event handler.
`public`
`constructor Create();` |  | Constructor for the class instance.
`procedure Assign(); override;` |  | Copies property values from the specified persistent object into the current class instance.
`procedure AssignTo(); override;` |  | Copies property values from the current class instance to the specified persistent object.
`function IsEqual();` |  | Determines whether the specified sizing contains the same values as the current class instance.
`procedure SetGridSpacing();` |  | Sets spacing properties in the class instance to the specified value.
`property Control: TWinControl; [r]` |  | The Control where the class instance is used.
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when the size or layout for child controls has been changed.
`published`
`property LeftRightSpacing: Integer; [rw]` |  | Minimum distance between the left or right edge for the Control and the left or right edge for a child control.
`property TopBottomSpacing: Integer; [rw]` |  | Minimum distance between the top or bottom edge of a Control and the top or bottom edge for a child control.
`property HorizontalSpacing: Integer; [rw]` |  | Minimum space between child controls which are horizontally adjacent.
`property VerticalSpacing: Integer; [rw]` |  | Minimum space between child controls which are vertically adjacent.
`property EnlargeHorizontal: TChildControlResizeStyle; [rw]` |  | Indicates how child controls are expanded and aligned horizontally on the parent Control.
`property EnlargeVertical: TChildControlResizeStyle; [rw]` |  | Indicates how child controls are expanded or aligned vertically on the parent Control.
`property ShrinkHorizontal: TChildControlResizeStyle; [rw]` |  | Indicates how child controls are shrunk and aligned horizontally on the parent Control.
`property ShrinkVertical: TChildControlResizeStyle; [rw]` |  | Indicates how child controls are shrunk and aligned vertically on the parent Control.
`property Layout: TControlChildrenLayout; [rw]` |  | Indicates the layout direction used when child controls are resized and arranged into rows and / or columns.
`property ControlsPerLine: Integer; [rw]` |  | The number of controls displayed per column or row for the orientation / fill direction specified in Layout.
`end;`

## Inheritance

`TControlChildSizing` |  | Provides settings to layout child-controls into a grid (table) layout.
`TPersistent`
?
`TObject`

## Description

TControlChildSizing is a TPersistent descendant which provides properties and methods used to layout, align, and resize child controls fitting into a grid on their parent control.

TControlChildSizing also provided "Spacing" settings. Those are applied to the grid and also to anchored or aligned controls outside the grid.

Layout and ControlsPerLine control if the grid is used, how it is sized and in which order the child-controls are placed into the grid.

EnlargeHorizontal, EnlargeVerticalHorizontal, ShrinkHorizontal, ShrinkVerticalHorizontal define how the cells of the grid are sized. Child-controls are then adjusted to that size depending on their BorderSpacing.CellAlignHorizontal/CellAlignVertical properties.

HorizontalSpacing, VerticalSpacingHorizontalSpacing, LeftRightSpacing, TopBottomSpacing can be used to add space between and around the cells.

See TChildControlResizeStyle and TControlChildrenLayout for details about the enumeration values used in the properties.

Additional information about child sizing and layout can be found on the Lazarus Wiki at:

Autosize / Layout (https://wiki.lazarus.freepascal.org/Autosize_/_Layout)

LCL AutoSizing (https://wiki.lazarus.freepascal.org/LCL_AutoSizing)

## See also

TChildControlResizeStyle |  | Defines how child controls are resized / aligned.
TControlChildrenLayout |  | Defines the logic used to arrange child controls.