Page 1 of 1

I must be doing something wrong. LoadRTF not working?

Posted: Wed Oct 06, 2010 11:06 pm
by GerryD
I've downloaded the trial version of Richview (V12.6.1) for Delphi 2007 and I'm trying to get it to read in an RTF document. I dropped a tRichView and a style component on my form along with a button with the following code. Basically cloned from one of the demo programs.

begin with RichViewTest do
begin
Clear;
DeleteUnusedStyles(True,True,True);
if loadRTF( 'RV.rtf') then
begin
MessageDlg ( 'Load RTF OK', mtError, [mbOK], 0 );
end;
end;
end;


I click the button and the Load RTF OK dialog pops up but there is nothing displayed in the RichView control.

This seem so basic I can't believe it's so badly broken. What and I missing?

Posted: Thu Oct 07, 2010 10:23 am
by Sergey Tkachenko
Call Format after LoadRTF.

Posted: Thu Oct 07, 2010 12:08 pm
by GerryD
That did the trick. Thanks.

Still not quite there

Posted: Fri Oct 08, 2010 11:37 am
by GerryD
Sergey Tkachenko wrote:Call Format after LoadRTF.
Calling format did get text displayed on my screen but the RTF formatting isn't working. There is only one font and text that was supposed to be bold is rendered in blue. It looks like RV is thinking it is plain text.

Can you point me in the right direction?

Posted: Sat Oct 09, 2010 6:28 am
by Sergey Tkachenko