How to limit the number of lines in a TRichEdit (Views: 100)
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?
Try keypress code like this:
procedure Form1.FMemo1KeyPress(Sender: TObject; var Key: Char);
if (Key = #13) and ((Sender as TRichEdit).Lines.Count >= 32) then
Key := #0;
<< Back to main page