I am trying to display a rtf string in a richedit control without success. What is wrong with the following code
- Code: Select all Expand view
- cText := "{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}"+CRLF+;
"{\colortbl ;\red0\green77\blue187;\red192\green80\blue77;}"+CRLF+;
"{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1031\f0\fs22 This is \b colored \b0 text\cf0 . \cf2 The background is color 1 and the foreground is color 2\cf0\par"+CRLF+;
"}"
oRtf := TRichEdit():Redefine( 4000, { || "" }, oDlg )
//oRtf:lHighLight = .f.
oRtf:LoadRTF (cText) // does not work
oRTF:Refresh()
//oRtf:LoadFromRTFFile( "Register.rtf" ) / from a file it is working
IsRTF (cText) returns .t., but it´s only working if I load it from a file.
Any help appreciated