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

# TCustomLabel.DoSetBounds

Performs a bounds change for the control.

## Declaration

Source position: stdctrls.pp line 1580

`protected procedure TCustomLabel.DoSetBounds(`
`ALeft: Integer;`
`ATop: Integer;`
`AWidth: Integer;`
`AHeight: Integer`
`); override;`

## Arguments

`ALeft` |  | New value for the Left property.
`ATop` |  | New value for the Top property.
`AWidth` |  | New value for the Width property.
`AHeight` |  | New value for the Height property.

## Description

DoSetBounds is an overridden method in TCustomLabel. It calls the inherited method to store the values in ALeft, ATop, AWidth, and AHeight to the corresponding properties in the control. Values in OptimalFill, WordWrap, and Autosize are used to determine if additional actions are needed for the bounds change.

When OptimalFill is True and AutoSize is False, the AdjustFontForOptimalFill method is called. If Width was changed and WordWrap is True, both the InvalidatePreferredSize and AdjustSize methods are called.

DoSetBounds is called from the ChangeBounds method in an ancestor class.

## See also

TCustomLabel.OptimalFill |  | If True, the font size is adjusted for optimal fill of the available space.
TCustomLabel.AutoSize |  | Enables or disables auto-sizing the control to its content.
TCustomLabel.WordWrap |  | Allows the caption to wrap to multiple lines when it is longer than the available Width.
TCustomLabel.AdjustFontForOptimalFill |  | Adjusts the font height for the control text to fill the available client area.
TControl.DoSetBounds |  | Internal function used to set the bounds for the control (Left, Top, Height, Width).