Sign in Join
FPDoc Onlineexperiment

TCustomLabel.AdjustFontForOptimalFill function

Member of TCustomLabelpublicIn unit StdCtrls

Adjusts the font height for the control text to fill the available client area.

Declaration

pascal
function AdjustFontForOptimalFill: Boolean

Function result

True when the font height was changed in the method.

Description

AdjustFontForOptimalFill is a Boolean function used to adjust the font height so that text in the label expands to fill the available client area for the control. AdjustFontForOptimalFill calls CalcFittingFontHeight to determine the font height needed to make the label text (caption) fill the Width for the control. The calculated font height is stored in the Font property.

The return value is True when the Font height was changed in the method.

AdjustFontForOptimalFill is called from DoSetBounds and UpdateSize when OptimalFill is set to True and AutoSize is set to False. It is also called when a new value is assigned to the OptimalFill property.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.