function MemoLines(const m: TMemo): Integer;
var
dc: THandle;
tm: TTextMetric;
begin
dc := GetDC(m.handle);
SelectObject(dc, m.Font.handle);
GetTextMetrics(dc, tm);
Result := (m.ClientRect.Bottom - m.ClientRect.Top) div
(tm.tmHeight + tm.tmExternalLeading);
DeleteDC(dc);
end;
// Beispielaufruf
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(inttostr(MemoLines(Memo1)));
end;