Unit 'StdCtrls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#lcl]

TCustomLabel.AdjustFontForOptimalFill

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

Declaration

Source position: stdctrls.pp line 1610

public function TCustomLabel.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

TCustomLabel.CalcFittingFontHeight

  

Calculates the font height needed to fill the specified width and height constraints.

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

  

Adjusts the size for the control based on settings in AutoSize and OptimalFill.

TCustomLabel.DoSetBounds

  

Performs a bounds change for the control.

TControl.Font

  

The font to be used for text display in this control.



CT Web help

CodeTyphon Studio