Page 1 of 1

Copy contents of RichView

Posted: Tue Aug 15, 2006 2:31 am
by Gerry
Hi, I have a (hopefully simple) newbie question.

Is there a way to copy the contents of a TRichView or TRichViewEdit control into another?

Posted: Tue Aug 15, 2006 9:55 am
by Yernar Shambayev
MemStream := TMemoryStream.Create;
try
rv.SaveRVFToStream(MemStream, False);
MemStream.Position := 0;
rv2.LoadRVFFromStream(MemStream);
finally
MemStream.Free;
end;
rv2.Format;

Posted: Tue Aug 15, 2006 11:43 pm
by Gerry
Yes, I was already doing it using memorystreams, I just thought there might be a more direct way. Thanks anyway! :)

Posted: Wed Aug 16, 2006 4:34 am
by Yernar Shambayev
AppendFrom, but this method does not copy inserted controls and tables (just ignores them).