Page 1 of 1

copy data between two TRichViewEdits

Posted: Wed May 21, 2008 8:32 am
by dmitry_oz
Hi Sergey,

I tried to copy between two richviewedits but did not have much luck.

1) tried to use stream but second RichViewEdit2 was blank

stream := TMemoryStream.Create;
try
RichViewEdit1.SaveRVFToStream(stream, false);
stream.Position := 0;
RichViewEdit2.LoadRVFFromStream(stream);
RichViewEdit2.Format;
finally
stream.Free;
end;
2)RichView.assign won't work

Could you help please?

Ignore

Posted: Thu May 22, 2008 4:28 am
by dmitry_oz
Please ignore, it works just fine.

Posted: Thu May 29, 2008 8:38 am
by 4stone
richview2.AppendFrom(richview1);
richview1.format;

Posted: Thu May 29, 2008 10:14 am
by Sergey Tkachenko
AppendFrom is the fastest way to copy data from one TRichView to another, but it does not support all item types, including controls and tables.