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

TControlChildSizing.ShrinkVertical

Various ways to fit controls into the available Height.

Declaration

Source position: controls.pp line 2008

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, and causes the height of child control to be determined using the Anchor and Align properties (like Delphi). For example if Anchors property of the control is [akTop], it means the distance is fixed between top border of the control and the child control. [akBottom] means the distance is fixed between the bottom border for the control and the bottom border for the child control.

When the parent is resized, the child is moved to keep the defined distances. [akLeft,akRight] means fixed distance to left border and fixed distance to right border. When the parent is resized, the controls width is changed (resized) to keep the left and right distance. Same for akTop, akBottom.

When Align is set to alLeft, the means the control Left and Top are adjusted to fill the available space with the Height at its maximum value. The Width is retained if akRight is not set. If akRight is set in the Anchors property, then the right distance is kept and the control width is resized. If there are several child controls with Align set to alLeft, they will not overlap and be placed side by side. Same for alRight, alTop, alBottom. (Always expand 3 sides).

When Align is alClient. The control will fill the available space in the client area on the parent control. Setting Align in two child controls to alClient can be used if there are maximum value (for width and/or height) in the Constraints property.

Order: alTop children are resized first, then alBottom, then alLeft, then alRight, and finally alClient.

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).

See also

TControlChildSizing.Change

  

Notifies the Control of the child sizing changes and signals the OnChange event handler.

TWinControl.DoChildSizingChange

  

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

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.