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

# TControlChildSizing.ShrinkVertical

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

## Declaration

Source position: controls.pp line 1998

`published property TControlChildSizing.ShrinkVertical : TChildControlResizeStyle read FShrinkVertical write SetShrinkVertical default crsAnchorAligning;`

## Description

ShrinkVertical is a TChildControlResizeStyle property which indicates if and how child controls are resized and aligned vertically 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 height and size constraints for the child controls. Child controls heights are not changed when the parent Control is resized.

crsScaleChilds

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

crsHomogenousChildResize

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

crsHomogenousSpaceResize

  Applies a uniform number of pixels as vertical spacing between child controls in the same column. The height for controls in a given column are derived using the preferred height for the controls and any height constraints (minimum or maximum) in the child controls. Any unused vertical space on the Control is allocated equally as spacing above, between, and below each row in the tabular layout - including on the top and bottom edges of the Control.

  Row heights do not change when the parent Control is resized; only the spacing between edges and rows is affected.

crsSameSize

  Child controls use a uniform height for all controls in the same row for the tabular layout. Size constraints (minimum or maximum) for child controls are enforced if the constraint would be enabled for the row size. The unused space on the parent Control, after spacing, is allocated equally to rows where a size constraint is not in effect. Row heights 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 TopBottomSpacing and VerticalSpacing.

Changing the value for the ShrinkVertical property causes the Change method to be called. This causes child controls to recalculate their preferred size and to be realigned on the Control. The OnChange event handler is also signalled (when assigned).

Use EnlargeVertical to specify the child sizing style applied when control heights 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.
TWinControl.Realign |  | Adjusts the size and placement for the control and all of its children.
TControl.Align |  | Specifies the placement of the control on its Parent control.
TControl.Anchors |  | The set of anchor definitions for this 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.
TChildControlResizeStyle |  | Defines how child controls are resized / aligned.