«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to detect text and font size changes

   

When creating components you may want to know when the user changed the font or text. This can be quite easily done using the CM_FONTCHANGED and CM_TEXTCHANGED messages.

type
  ...
  TComponent1 = class(TComponent)
  private
    ...
    procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
    procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
    ...
  end;

procedure TComponent1.CMTextChanged(var Message:TMessage);
begin
  ...
end;
procedure TComponent1.CMFontChanged(var Message:TMessage);
begin
  ...
end;
Author: Unknown
Added: 2007-06-02
Last updated: 2007-09-24

« Return to contents »