Author: Jonas Bilinkevicius
I have a form with fixed size boxes. I want to prevent the user from overfilling
it. Is it possible to limit the height or at least the number of lines in a
TRichEdit?
Answer:
Try keypress code like this:
1 2 procedure Form1.FMemo1KeyPress(Sender: TObject; var Key: Char);
3 begin4 if (Key = #13) and ((Sender as TRichEdit).Lines.Count >= 32) then5 Key := #0;
6 end;