Maximum width of TMemo

Is there a way to make TMemo text longer than 1024 in 1 line?
Take a look at this simple code:

procedure TForm1.Button2Click(Sender: TObject);
var
    s: string;
    i: integer;
begin
    s := '';
    for i := 0 to 10000 do
      s := s + 'a';

    Memo1.Clear;
    Memo1.Lines.Add(s);
end;

      

Long text "s" will be displayed on multiple lines. Memo1 will automatically wrap text after 1024 characters.

+3


source to share


1 answer


TMemo is a wrapper for the built-in multiline editing tool and is subject to limitations. From INFO: Size limits for multi-line edit control :



Multi-line edit control is also subject to the following restrictions:

  • The maximum number of characters in one line is 1024.
  • The maximum line width is 30,000 pixels.
  • The maximum number of lines is approximately 16,350.
+6


source







All Articles