Copy RichEdit RTF in other RichEdit  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 03/09/99

Tip accessed 554 times

 


This example copies the text of RE1 (RichEdit1) in RE2 (another RichEdit), but conserving the format of the text, colors, etc.


 procedure TForm1.Button2Click(Sender: TObject);
 var
   Corriente: TMemoryStream;
 begin
   Corriente := TMemoryStream.Create;
   try
     RE1.Lines.SaveToStream(Corriente);
     Corriente.Seek(0,soFromBeginning);
     RE2.Lines.LoadFromStream(Corriente);
   finally
     if Assigned(Corriente) then Corriente.Free;
   end;
 end;