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

Reply via email to