Board index » delphi » Rich Text in a RRichEdit box

Rich Text in a RRichEdit box

Hello,

How can I load Rich Text in to a TRichEdit at design Time.  I want to
have a rich edit filled with text when you run the program, but I don't
want to include a .rtf file that loads when the program begins.  It
seems the only way to deal with the TRichEdit text is as straigt text at
design time.

Any help appreciated.

 

Re:Rich Text in a RRichEdit box


Quote
In article <390D919B.B0966...@aici.com>, Darron Stante wrote:
> How can I load Rich Text in to a TRichEdit at design Time.  I want to
> have a rich edit filled with text when you run the program, but I don't
> want to include a .rtf file that loads when the program begins.  It
> seems the only way to deal with the TRichEdit text is as straigt text at
> design time.

Yes, that is true. The Lines property is not "format-aware". The simplest
way to include some rich text is to make a resource script file (extension
RC) with a line like

 RTF1 RCDATA somefile.rtf

Produce the somefile.rtf file itself with WordPad. Add the RC file to your
project group (D5) or compile it with brcc32 to a RES and add a $R
statement for it. You can now connect a TResourceStream to the resource at
runtime and load the richedit from it via Lines.LoadFromStream.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads