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.
TComponent1 = class(TComponent) ... private ... procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; ... procedure TComponent1.CMTextChanged(var Message:TMessage); begin ... end; procedure TComponent1.CMFontChanged(var Message:TMessage); begin ... end;
Tags: borland, change, CM_FONTCHANGED, CM_TEXTCHANGED, code, codegear, Delphi, detect, faq, font, freeware, open source, programming, size, source, source code, text, tip, trick, width
Merlin’s Delphi Forge
Leave a comment