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

# TSizeConstraints

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

Holds minimum and maximum values for the width or height of a control.

## Declaration

Source position: controls.pp line 705

`type TSizeConstraints = class(TPersistent)`
`protected`
`procedure Change; virtual;` |  | Adjusts the size for the associated Control, and signals the OnChange handler when assigned.
`procedure AssignTo(); override;` |  | Copies property values to the specified persistent object.
`procedure SetMaxHeight(); virtual;` |  | Sets the value for the MaxHeight property.
`procedure SetMaxWidth(); virtual;` |  | Sets the value for the MaxWidth property.
`procedure SetMinHeight(); virtual;` |  | Sets the value for the MinHeight property.
`procedure SetMinWidth(); virtual;` |  | Sets the value for the MinWidth property.
`public`
`constructor Create(); virtual;` |  | Constructor for the class instance.
`procedure UpdateInterfaceConstraints; virtual;` |  | Applies size constraints from the specified Control to the widgetset class instance.
`procedure SetInterfaceConstraints(); virtual;` |  | Used by the LCL interface to set the widgetset constraints in the class instance.
`function EffectiveMinWidth; virtual;` |  | Determines the minimum applicable width given the local and interface constraints.
`function EffectiveMinHeight; virtual;` |  | Determines the minimum applicable height given the local and interface constraints.
`function EffectiveMaxWidth; virtual;` |  | Determines the maximum applicable width given the local and interface constraints.
`function EffectiveMaxHeight; virtual;` |  | Determines the maximum applicable height given the local and interface constraints.
`function MinMaxWidth();` |  | Determines the constrained Width and transfers it to the widget.
`function MinMaxHeight();` |  | Determines the constrained Height and transfers it to the widget.
`procedure AutoAdjustLayout();` |  | Adjusts width and height values in the class using the specified scaling factors.
`property MaxInterfaceHeight: Integer; [r]` |  | The maximum height allowed by the widget.
`property MaxInterfaceWidth: Integer; [r]` |  | The maximum width allowed by the widget.
`property MinInterfaceHeight: Integer; [r]` |  | The minimum height allowed by the widget.
`property MinInterfaceWidth: Integer; [r]` |  | The minimum width allowed by the widget.
`property Control: TControl; [r]` |  | The associated Control to which these constraints apply.
`property Options: TSizeConstraintsOptions; [rw]` |  | Options used to determine the size constraints.
`published`
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when a value in the class instance has been changed.
`property MaxHeight: TConstraintSize; [rw]` |  | The maximum height for the associated Control.
`property MaxWidth: TConstraintSize; [rw]` |  | The maximum width for the associated Control.
`property MinHeight: TConstraintSize; [rw]` |  | The minimum height for the associated Control.
`property MinWidth: TConstraintSize; [rw]` |  | The minimum width for the associated Control.
`end;`

## Inheritance

`TSizeConstraints` |  | Holds minimum and maximum values for the width or height of a control.
`TPersistent`
?
`TObject`

## Description

TSizeConstraints is a TPersistent descendant which contains size constraints used to control the minimum or maximum width or height for an associated control. TSizeConstraints is the type used to implement the Constraints property in TControl and descendent classes.

The initial values for properties are retrieved from the widgetset class instance for the Control when its handle has been allocated. Values in TSizeConstraints properties are used when the Control is resized or its layout is adjusted, and prevent the control from being resized to Width or Height values that are in excess of the specified minimum or maximum values. If properties are modified in TSizeConstraints, the associated control is updated to apply the new size constraints (when needed).

## See also

TSizeConstraints.EffectiveMaxHeight |  | Determines the maximum applicable height given the local and interface constraints.
TSizeConstraints.EffectiveMaxWidth |  | Determines the maximum applicable width given the local and interface constraints.
TSizeConstraints.EffectiveMinHeight |  | Determines the minimum applicable height given the local and interface constraints.
TSizeConstraints.EffectiveMinWidth |  | Determines the minimum applicable width given the local and interface constraints.
TSizeConstraints.MinMaxHeight |  | Determines the constrained Height and transfers it to the widget.
TSizeConstraints.MinMaxWidth |  | Determines the constrained Width and transfers it to the widget.
TControl.Constraints |  | Contains the minimum and maximum Width and Height for the control.
TControl.AdjustSize |  | Smart way to DoAutoSize.
TControl.AutoAdjustLayout |  | Applies an automatic adjustment layout policy to the control.