Insert RTF at the current line in TRichView

General TRichView support forum. Please post your questions here
Post Reply
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Insert RTF at the current line in TRichView

Post by vit »

Hi!

I need to insert RTF into TRichView at the current line, without a new line. In TRichViewEdit I use InsertRTFFromStreamEd and it works fine. But TRichView.LoadRTFFromStream does the new line. Do I need to adjust any settings to avoid inserting at the new line?

Thanks!
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Insert RTF at the current line in TRichView

Post by Sergey Tkachenko »

Do you mean a blank line before the loaded content?
LoadRTFFromStream adds new content to the end, it does not clear existing content, so call Clear before LoadRTFFromStream.

Or do you want to add RTF content to the end of existing paragraph?
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Re: Insert RTF at the current line in TRichView

Post by vit »

Or do you want to add RTF content to the end of existing paragraph?
Yes I ment that
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Insert RTF at the current line in TRichView

Post by Sergey Tkachenko »

Unfortunately, there are no methods for this.
You can
1) Use TRichViewEdit instead of TRichView, use InsertRTFFromStreamEd, then assign ReadOnly = True.
2) Load RTF in a temporal hidden TRichView, save it as RVF (SaveRVFToStream), then use AppendRVFFromStream, with ParaNo parameter = -1. But it allows adding content only to the last paragraph.
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Re: Insert RTF at the current line in TRichView

Post by vit »

Ok, thanks!
Post Reply