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

# TControlChildSizing.ShrinkHorizontal

Indicates how child controls are shrunk and aligned horizontally on the parent Control.

## Declaration

Source position: controls.pp line 1996

`published property TControlChildSizing.ShrinkHorizontal : TChildControlResizeStyle read FShrinkHorizontal write SetShrinkHorizontal default crsAnchorAligning;`

## Description

ShrinkHorizontal is a TChildControlResizeStyle property which indicates how child controls are resized and aligned horizontally on the parent control. It can contain one of the values from the TChildControlResizeStyle enumeration. The default value for the property is crsAnchorAligning.

Child sizing styles include:

crsAnchorAligning

  Uses a static layout based on the preferred width and size constraints for the child controls. Child controls widths are not changed when the parent Control is resized.

crsHomogenousChildResize

  Applies a homogenous width to child controls in a given column on the tabular layout. The width of child controls is reduced to fill the client area in the parent Control after spacing and size constraints have been applied.

crsHomogenousSpaceResize

  Applies a uniform number of pixels as horizontal spacing between child controls on the same row. The width for controls in a given column are derived using the preferred width for the controls and any width constraints (minimum or maximum) in the child controls. Any unused horizontal space on the Control is allocated equally as spacing before, between, and after each column in the tabular layout - including on the left and right edges of the Control.

  Column widths do not change when the parent Control is resized; only the spacing between edges and columns is affected.

crsScaleChilds

  Scales the width for child controls while keeping the space between them fixed. Children are resized so that the control widths are a ratio of their preferred widths (or size constraints) relative to the client area on the parent Control. Controls are scaled to fill the client width in the parent Control. All controls in a given column are given the same derived width.

crsSameSize

  Child controls use a uniform size for all controls in the same column for the tabular layout. Size constraints (minimum or maximum) for child controls are enforced if the constraint would be enabled for the column size. The client width for the parent Control, after spacing, is allocated equally to columns where a size constraint is not in effect. Column widths are recalculated when the parent Control is resized.

See TChildControlResizeStyle for more information about the child sizing layout algorithms.

The styles in EnlargeHorizontal, EnlargeVertical, ShrinkHorizontal, and ShrinkVertical are used when Layout is set to a value other than cclNone. The styles apply to child controls which have their Anchors set to [akLeft, akTop], Align set alNone, and are not anchored to another control using AnchorSide. Any control with other Anchors or Align settings cannot be displayed in the tabular layout.

The child controls are positioned using the BorderSpacing for the control (and its parent control) and the spacing values in LeftRightSpacing and HorizontalSpacing.

Setting a new value for ShrinkHorizontal causes the Change method to be called. This invalidate the preferred sizes for the child controls, and causes them to be realigned. The OnChange event handler is also signalled (when assigned).

Use EnlargeHorizontal to specify the child sizing style applied when control widths are expanded to fit within the client area for the parent Control.

## See also

TControlChildSizing.Control |  | The Control where the class instance is used.
TControlChildSizing.Layout |  | Indicates the layout direction used when child controls are resized and arranged into rows and / or columns.
TControlChildSizing.Change |  | Notifies the Control of the child sizing changes and signals the OnChange event handler.
TControlChildSizing.OnChange |  | Event handler signalled when the size or layout for child controls has been changed.
TControlChildSizing.EnlargeHorizontal |  | Indicates how child controls are expanded and aligned horizontally on the parent Control.
TControlChildSizing.LeftRightSpacing |  | Minimum distance between the left or right edge for the Control and the left or right edge for a child control.
TControlChildSizing.HorizontalSpacing |  | Minimum space between child controls which are horizontally adjacent.
TChildControlResizeStyle |  | Defines how child controls are resized / aligned.
TControlBorderSpacing |  | Describes the (minimum) spacing around a control.
TSizeConstraints |  | Holds minimum and maximum values for the width or height of a control.
TControl.BorderSpacing |  | Determines the inner and outer border spacing for this control.
TControl.Constraints |  | Contains the minimum and maximum Width and Height for the control.