Quick and dirty habe ich das gestern (selbes Problem
) so gelöst.
Delphi-Quellcode:
var
lab: TLabel;
begin
lab := TLabel.create(form1);
lab.autosize := true;
lab.font := button1.font;
lab.caption := button1.caption;
result := lab.width;
lab.free;
end;