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

# TCustomLabel.OptimalFill

If True, the font size is adjusted for optimal fill of the available space.

## Declaration

Source position: stdctrls.pp line 1603

`protected property TCustomLabel.OptimalFill : Boolean read FOptimalFill write SetOptimalFill default False;`

## Description

OptimalFill is a Boolean property which indicates that the Font height should be maximized to fill the available width in the control. The default value for the property is False.

Setting OptimalFill to True causes AutoSize to be set to False. The AdjustFontForOptimalFill method is called to get and apply the maximum font height allowed for the Width and Height in the control.

Changing the value for the property causes Invalidate to be called to redraw the control.

## See also

TCustomLabel.AutoSize |  | Enables or disables auto-sizing the control to its content.
TCustomLabel.AdjustFontForOptimalFill |  | Adjusts the font height for the control text to fill the available client area.
TControl.Width |  | The horizontal size for the control.
TControl.Height |  | The vertical size for the control.
TControl.Font |  | The font to be used for text display in this control.
TControl.Invalidate |  | Causes a delayed Repaint of the control by marking its visible area of the control as invalid.