TControl.FontChanged procedure
Handles changes to the Font property.
Declaration
procedure FontChanged(Sender: TObject); virtualDescription
FontChanged is a procedure used to perform actions needed when the
value in the
Font property has been changed for the control.
FontChanged ensures that values in
ParentFont and
DesktopFont are set to
False to reflect the font assignment.
FontChanged calls the Invalidate method to force the control to be
redrawn when it is Visible. The CM_FONTCHANGED control change message is
performed to reflect the change in the control state. When
AutoSize contains True, the
InvalidatePreferredSize and AdjustSize methods are
called to update the control dimensions using the new font.
FontChanged is assigned to the OnChange event handler for the
Font property in the constructor for the class instance.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
