Como não deixar um Memo ter mais de 3 linhas?
Olá amigos, como posso bloquear para que um memo não fique com mais de 3 linhas?
já tentei por no OnKeyPress:
if (DBMemo3.Lines.Count > 3) then //and (Key = #13) then
Key := 0;
porém nao funcionou... :(
desde já agradeço.
[]s
já tentei por no OnKeyPress:
if (DBMemo3.Lines.Count > 3) then //and (Key = #13) then
Key := 0;
porém nao funcionou... :(
desde já agradeço.
[]s
Titanius
Curtidas 0
Respostas
Flaviocont
21/12/2006
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
if ((key = chr(13)) and (Memo1.Lines.Count = 3)) then key:= chr(27);
if Memo1.Lines.Count > 3 then
begin
Memo1.Lines.Delete(3);
key:= chr(0);
end;
end;
begin
if ((key = chr(13)) and (Memo1.Lines.Count = 3)) then key:= chr(27);
if Memo1.Lines.Count > 3 then
begin
Memo1.Lines.Delete(3);
key:= chr(0);
end;
end;
GOSTEI 0