Hi there,
I need to move some data from one TRichViewEdit to another -- actually, I'm inserting the entire contents of one TRVE into the cursor position of the other. The simplest way to do this would be using copy/paste via the clipboard, but I don't want to do that because that will replace the previous contents of the clipboard without the user's permission.
Does anyone have any suggestions for moving data between two TRichViewEdits without using the clipboard?
All help appreciated,
Martin
Copy/paste without using the clipboard
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm
I think you could use this:
I type the code in editor. may be it need some changes in method namesvar
AStream: TMemoryStream;
begin
AStream := TMemoryStream.Create;
RichViewEdit1.SaveRVFToStream(AStream, True); // Copy the Selection into Stream
AStream.Position:=0;
RichViewEdit2.InsertRVFFromStream(AStream);
RichViewEdit2.Format;
end;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
If you need to copy the entire RichViewEdit1, call SaveRVFToStream with the last parameter = False.
To insert in the position of caret, use InsertRVFFromStreamEd. Do not call Format. Format is necessary after LoadRVFFromStream or InsertRVFFromStream, but not needed after InsertRVFFromStreamEd.
To insert in the position of caret, use InsertRVFFromStreamEd. Do not call Format. Format is necessary after LoadRVFFromStream or InsertRVFFromStream, but not needed after InsertRVFFromStreamEd.
Last edited by Sergey Tkachenko on Sun Mar 04, 2007 10:04 am, edited 1 time in total.
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm