Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TMemo max width

Is there any way to make TMemo display text longer than 1024 into 1 line?
Take a look 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;

The long text "s" will be displayed in multiple lines. The Memo1 will automatically wrap the text after 1024 characters.

like image 299
Kawaii-Hachii Avatar asked Mar 18 '23 18:03

Kawaii-Hachii


1 Answers

A TMemo is a wrapper for a native multi line edit control and is subject to the limitations it has. From INFO: Size Limits for a Multiline Edit Control:

A multiline edit control is also subject to the following limitations:

  • The maximum number of characters in a single line is 1024.
  • The maximum width of a line is 30,000 pixels.
  • The maximum number of lines is approximately 16,350.
like image 56
Sertac Akyuz Avatar answered Mar 22 '23 22:03

Sertac Akyuz