Styles lost when streaming RVF between TRichViews
Posted: Sun May 10, 2009 6:15 pm
Hello, Sergey...
Sorry to bother you, but I think I am missing something really obvious. I am trying to copy the contents of a TRichView on one form to a TRichView that is on another form. For some reason, no matter what I do, the styles seem to be lost when I do so (underline, bold, bullets/numbering, etc).
Here is the code I am using to do so:
Both TRichViews have a TRVStyle with default settings. I have tried calling DeleteUnusedStyles and other things before calling the above code. But, nothing seems to help.
I must be missing something really obvious, because I don't have a problem loading an RVF stream from a file or memory, just when doing this.
Any ideas or directions on what I am missing here?
Thanks...
Sorry to bother you, but I think I am missing something really obvious. I am trying to copy the contents of a TRichView on one form to a TRichView that is on another form. For some reason, no matter what I do, the styles seem to be lost when I do so (underline, bold, bullets/numbering, etc).
Here is the code I am using to do so:
Code: Select all
var
aMemStream : TMemoryStream;
begin
aMemStream := TMemoryStream.Create;
try
aSourceRV.SaveRVFToStream(aMemStream, False);
aMemStream.Position := 0;
aTargetRV.LoadRVFFromStream(aMemStream);
aTargetRV.Format;
finally
aMemStream.Free;
end;
end;
I must be missing something really obvious, because I don't have a problem loading an RVF stream from a file or memory, just when doing this.
Any ideas or directions on what I am missing here?
Thanks...