Store more than 64 KB in a TRichEdit

posted 14 Mar 2010, 18:29 by Delphi Basics   [ updated 14 Mar 2010, 18:30 ]
By default, a TRichedit's text is limited to 64 KB. Setting the Maxlength property to $7FFFFFF0 allows you to have approx. 2GB of text.

procedure TForm1.Button1Click(Sender: TObject);
begin
   RichEdit11.MaxLength := $7FFFFFF0;
end;

or

procedure TForm1.Button1Click(Sender: TObject);
begin
   SendMessage(RichEdit1.Handle, EM_EXLIMITTEXT, 0, $7FFFFFF0);
end;

Comments