On 11/17/13, Avishai <[email protected]> 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.

Bart

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to