[Lazarus] Fit TFrom's width so that it's caption isn't cut off?

Bart bartjunk64 at gmail.com
Sun Nov 17 18:04:46 CET 2013

On 11/17/13, Avishai <avishai.gore at gmail.com> wrote:

> function GetTextHeight(ACtrl: TControl): Integer;
> var
>   C: TBitMap;
> begin
>   Result:= -1;
>   C := TBitmap.Create;
>   try
>     C.Canvas.Font.Assign(ACtrl.Font);
>     Result:= C.Canvas.TextHeight('TextHeight');
>   finally
>     C.Free;
>   end;
> end;

Is the canvas of the area where the caption is drawn the same as
TForm's canvas, and is the font the same? I have no idea.
And it does not take the bordericons into account.


More information about the Lazarus mailing list