RE:Determinar Cuantas lineas tiene un Campo Memo.
Este ejemplo sirve para saber cuantas lineas caben en un Tmemo
procedure TForm1.Button1Click(Sender: TObject);
function LineasVisibles(Memo: TMemo): integer;
Var
Oldfont : HFont; {the old font}
DC : THandle; {Device context handle}
i : integer; {loop variable}
Tm : TTextMetric; {text metric structure}
TheRect : TRect;
begin
DC := GetDC(Memo.Handle);
try
OldFont := SelectObject(DC, Memo.Font.Handle);
try
GetTextMetrics(DC, Tm);
Memo.Perform(EM_GETRECT, 0, longint(@TheRect));
Result := (TheRect.Bottom - TheRect.Top) div
(Tm.tmHeight + Tm.tmExternalLeading);
finally
SelectObject(DC, Oldfont);
end;
finally
ReleaseDC(Memo.Handle, DC);
end;
end;
begin
Label1.Caption:=IntToStr(LineasVisibles(Memo1));
end;
Este ejmplo fue tomado de http://www.q3.nu/trucomania
Suerte