How to Size a Component Precisely

Posted December 15th @ 4:01 pm by m3Rlin

In the Borland Delphi and in the Borland Kylix IDEs you can precisely resize components to the exact size that you need. To resize a component to an exact size you can either use the Object Inspector and set the Height and Width values or use the Shift key to size components by 1 pixel.

How to Detect Font and Text Sizes

Posted December 15th @ 2:01 pm by m3Rlin

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;

Next Entries »