RichEditControl.RtfText Property

Gets or sets the formatted text content of the control.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v20.1.dll

Declaration

[Bindable(true)]
[Browsable(false)]
public string RtfText { get; set; }
<Bindable(True)>
<Browsable(False)>
Public Property RtfText As String

Property Value

Type Description
String

A string, containing the document's content in rich text format.

Remarks

Use this property to load an RTF content to the RichEditControl.

The RtfText property value is loaded as a new document in the rich text format. Check the RtfText property value when the RichEditControl.DocumentLoaded event handler, i.e. when the document is fully loaded.

The following code snippet displays the word "Test" in blue.

            string rtfString = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1049
{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}
{\f1\fswiss\fcharset0 Arial;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs32 Test.\cf0\b0\f1\fs20\par}";
            document.RtfText = rtfString;

Implements

See Also