Page 1 of 1

Insert RTF at the current line in TRichView

Posted: Wed Sep 06, 2017 10:24 am
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!

Re: Insert RTF at the current line in TRichView

Posted: Wed Sep 06, 2017 11:25 am
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?

Re: Insert RTF at the current line in TRichView

Posted: Wed Sep 06, 2017 11:26 am
by vit
Or do you want to add RTF content to the end of existing paragraph?
Yes I ment that

Re: Insert RTF at the current line in TRichView

Posted: Wed Sep 06, 2017 11:38 am
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.

Re: Insert RTF at the current line in TRichView

Posted: Wed Sep 06, 2017 11:40 am
by vit
Ok, thanks!