To limit the characters in a line of TMemo lazarus / 31-LCL ---------------------------------------------------------------------- asdf · 2011-03-27 05:24 In my project, I will let the user to describe in TMemo with the limit of 150 characers per line but no limit of lines. How can I do that ? And what is the technique to pick up each sentence from such Tmemo ? ---------------------------------------------------------------------- TurboRascal · 2011-03-27 07:08 A quick and simple way to limit typed text: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: char);begin  if (Length(Memo1.Text) >= 150) and (key <> #08) then    key := #0end;     While cursor and delete keys work when blocked, backspace (#08) does not so I added a check for it too. This however is far from perfect and some more work is required; the problem is that you can paste text at will. To use this properly, you should either disable pasting or check what is being pasted... ---------------------------------------------------------------------- asdf · 2011-03-28 04:04 The user may enter data into TMemo in many lines. But in each line, I would like to limit only 150 characters. ---------------------------------------------------------------------- typo · 2011-03-28 04:43 See this: http://www.lazarus.freepascal.org/index.php/topic,10691.0.html