Copy from TRichViewEdit to clipboard

General TRichView support forum. Please post your questions here
Post Reply
spike
Posts: 2
Joined: Fri Oct 12, 2007 3:58 pm

Copy from TRichViewEdit to clipboard

Post by spike »

I load a formated text from a non empty TMemoryStream into my TRichViewEdit then copy data to the clipboard via CopyRTF method but when I check there's nothing in the clipboard. :shock:

Code:

form := TForm.Create(nil);
rich := TRichViewEdit.Create(form);
rich.Name := 'rich1';
rich.Parent := form;
rich.LoadTextFromStream(memoryStream)
rich.CopyRTF;
rich.Free;
form.Free;

I would appreciate a little help.... :(
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Only selected fragment is copied.
In addition, TRVStyle is required:

Code: Select all

form := TForm.Create(nil); 
rich := TRichViewEdit.Create(form); 
rich.Name := 'rich1'; 
rich.Parent := form; 
rvstyle := TRVStyle.Create(form);
rich.Style := rvstyle;
memoryStream.Position := 0;
rich.LoadTextFromStream(memoryStream) 
rich.Format;
rich.SelectAll;
rich.CopyRTF; 
form.Free;
spike
Posts: 2
Joined: Fri Oct 12, 2007 3:58 pm

Post by spike »

Thanx man

It works beautyfully!!!! :P
Post Reply