Examples Delphi

Sometimes you may need to know how wide a string is in pixels, e.g. for dynamically generated forms.
This depends of course on the selected font characteristics. Windows and the VLC provide a function TextWidth which is a method of TCanvas:
TCanvas.TextWidth(sString);