Delphi Component Messages

Posted December 15th @ 1:56 pm by m3Rlin

Delphi sends messages for notification of events that are only applicable to Delphi components. They are like Windows messages in use. If you have a component that publishes the Font property the component probably needs to be repainted if any subproperties in the Font are changed. Changing the Font property does not necessarily generate a [...]

How to Get a String’s Width in Pixels, Not in Characters

Posted December 15th @ 7:27 am by m3Rlin

To determine the width of a string in pixels using the active font and output it’s best to use this method:

(* sString - (string) Can be any string constant or variable.
**
** For example:
** TCanvas.TextWidth(’m3Rlin’);
** TCanvas.TextWidth(Edit1.Text);
** TCanvas.TextWidth(OpenDialog1.FileName);
[...]

Next Entries »