General TRichView support forum. Please post your questions here
spike
Posts: 2 Joined: Fri Oct 12, 2007 3:58 pm
Post
by spike » Fri Oct 12, 2007 4:09 pm
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.
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: 17808 Joined: Sat Aug 27, 2005 10:28 am
Contact:
Post
by Sergey Tkachenko » Fri Oct 12, 2007 5:55 pm
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 » Fri Oct 12, 2007 6:03 pm
Thanx man
It works beautyfully!!!!