Load multiple pieces of data into TRichView/TRichViewEdit

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Load multiple pieces of data into TRichView/TRichViewEdit

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17522
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Load multiple pieces of data intoTRichView/TRichViewEdit

Post 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
Post Reply