Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TWinControl.ChildSizing

Provides a grid (table) layout for the children of this control.

Declaration

Source position: controls.pp line 2329

public property TWinControl.ChildSizing : TControlChildSizing
  read FChildSizing
  write SetChildSizing;

Description

ChildSizing provides access to the TControlChildSizing properties and methods of the control. Those manage how the child-controls are resized and placed into a grid layout.

ChildSizing is an alternative to using Anchors and Align properties to position and resize child controls.

Use the Layout property to enable the grid and specify the order and direction in which child controls are aligned. This affects how TControlChildSizing.ControlsPerLine determines the size of grid setting either the amount of columns or rows. The default is cclNone and disables the grid layout.

Choose a resize algorithm for shrinking or growing children's width and height. This does nothing when cclNone is chosen.

Spacing between and around the cells of the grid can be set as part of the TControlChildSizing. It can also be set by using the BorderSpacing of individual child-controls. The TControlChildSizing properties for spacing are also used when the layout is set to cclNone. They affect child-controls that are anchored or aligned in a similar manner as setting the child's BorderSpacing.

See TControlChildSizing for more detailed information about the properties and methods in the class instance.

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)

Version info

Implementation refactored in LCL version 4.0. This may result in behaviour that differs from previous LCL versions. Children with Constraints.MaxWidth / MaxHeight now limit the size of their column/row. In version 4.2 that was fixed to only apply for children with Constraints.MaxWidth/MaxHeight and BorderSpacing.CellAlignHorizontal/CellAlignVertical = ccaFill. Values other than ccaFill can be used to get the layout behaviour of version 3.

See also

TWinControl.ControlCount

  

The number of child controls in the Controls property.

TWinControl.Controls

  

Provides indexed access to the child controls for the class instance.

TWinControl.AlignControls

  

Repositions and resizes the control and child controls.

TWinControl.AdjustClientRect

  

Override this method when the ClientRect for a control differs from the default value.

TWinControl.DoChildSizingChange

  

Called after a change in ChildSizing information to trigger further processing.

TWinControl.InvalidatePreferredChildSizes

  

Flags the preferred sizes of all child controls as invalid (recursively).

TControl.Align

  

Specifies the placement of the control on its Parent control.

TControl.Anchors

  

The set of anchor definitions for this control.

TControlChildSizing

  

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


Version 4.4 Generated 2025-11-08 Home