Re: How to make TCheckBox autosize work correctly on Linux?

Martin Wynne via fpc-pascal <[email protected]> Tue, 6 Jan 2026 23:50:43 +0000
Newsgroups gmane.comp.compilers.free-pascal.general
Message-ID <[email protected]>
On 06/01/2026 23:15, Bo Berglund via fpc-pascal wrote:
> Did not work:
> 
> Error: Identifier not found "ControlCanvas"
> 
> Where is this item declared?

Sorry, that was Delphi code for Windows. In Lazarus for cross-platform 
do this:

uses
   LCLIntf;

var
   w,h:integer;

begin
   with checkbox do begin
    AutoSize:=False;
    Caption:='new text';
    GetTextSize(Font,Caption,w,h);
    Width:=w+30;
   end;


Martin.
_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal