Page 1 of 1

Load multiple pieces of data into TRichView/TRichViewEdit

Posted: Sun Dec 15, 2019 11:32 am
by jota
Hi.
How can I add, sequentially, a series of text values and RVF values, in a richview or richviewedit, without losing the previous piece.
Small example?
Thanks in advance.

Re: Load multiple pieces of data intoTRichView/TRichViewEdit

Posted: Sun Dec 15, 2019 2:56 pm
by Sergey Tkachenko

Code: Select all

procedure AddDoc(Stream: TStream; rv: TCustomRichView); 
var ItemCount: Integer; 
begin 
  ItemCount := rv.ItemCount; 
  Stream.Position := 0; 
  rv.InsertRVFFromStream(Stream, rv.ItemCount); 
end; 

rv.Clear; 
rv.DeleteUnusedStyles(True, True, True); 
// streams contain RVF documents
AddDoc(Stream1, rv); 
AddDoc(Stream2, rv); 
AddDoc(Stream3, rv);
rv.Format;
To add from files, use TFileStream