就是得不到,siz.cy的植不对,是不是MEMO.HANDLE不成呀,
我的QQ63070398

解决方案 »

  1.   

    用以下这个就可以:
    var
     siz :size;
     src : string;
    begin
      src := memo1.lines.strings[0];
      GetTextExtentpoint(Form1.Canvas.Handle,pchar(src),length(src),siz);
    end;
      

  2.   

    用canvas.textextentReturns the width and height, in pixels, of a string rendered in the current font.type
      TSize = record    cx: Longint;
        cy: Longint;  end;function TextExtent(const Text: string): TSize;