Skip to main content

RichEditControl.RtfText Property

Gets or sets the formatted text content of the control.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v24.2.dll

Declaration

[Bindable(true)]
[Browsable(false)]
public string RtfText { get; set; }

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.

View Example

            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;

The following code snippets (auto-collected from DevExpress Examples) contain references to the RtfText property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also