windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-cd2e6d23.md
Gets or sets the control’s content as a plain text.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.XtraRichEdit.v25.2.dll
NuGet Package : DevExpress.Win.RichEdit
public override string Text { get; set; }
Public Overrides Property Text As String
| Type | Description |
|---|---|
| String |
A string, containing the document’s unformatted text.
|
Use the Text property to get the plain text displayed in the RichEditControl.
richEditControl.Text = "Item 1\r\nItem 2\r\nItem 3\r\nItem 4\r\n";
richEditControl.Text = "Item 1" & vbCrLf & "Item 2" & vbCrLf & "Item 3" & vbCrLf & "Item 4" & vbCrLf
The RichEditControl.ContentChanged event fires when the document is loaded using the Text property.
Check the Text property value in the RichEditControl.DocumentLoaded event handler, i.e., when the document is fully loaded.
Use the following properties to retrieve text in other formats:
The following code snippets (auto-collected from DevExpress Examples) contain references to the Text 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.
winforms-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L20
buttonCustomAction.Tag = richEditControl;
richEditControl.Text = "Click the 'Custom Action' button located in the ribbon to invoke the 'Find and Replace' dialog switched to the 'Find' tab and with the 'test' word used for search";
#endregion #ShowSearchFormMethod
server.Text = "some HTML text";
richEditControl1.Text = server.HtmlText;
}
winforms-tabbed-ui-control-based-document/CS/DcoumentManagerContentGenerator/Form1.cs#L31
newTB.Name = s + index.ToString();
newTB.Text = s + " " + index.ToString();
documentManager2.View.BeginUpdate();
winforms-spell-checker-get-started/CS/XtraSpellCheckerGetStarted/Form1.cs#L23
richTextBox1.Text = sText;
richEditControl1.Text = sText;
winforms-richedit-adjust-left-document-padding/CS/Form1.cs#L19
richEditControl1.Text = "Test";
}
winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L22
buttonCustomAction.Tag = richEditControl
richEditControl.Text = "Click the 'Custom Action' button located on the RibbonControl to invoke the 'Find and Replace' dialog switched to the 'Search' tab and with the 'test' word used for search"
' #End Region ' #ShowSearchFormMethod
server.Text = "some HTML text"
richEditControl1.Text = server.HtmlText
End Using
winforms-tabbed-ui-control-based-document/VB/DcoumentManagerContentGenerator/Form1.vb#L33
newTB.Name = s & index.ToString()
newTB.Text = s & " " & index.ToString()
documentManager2.View.BeginUpdate()
winforms-spell-checker-get-started/VB/XtraSpellCheckerGetStarted/Form1.vb#L19
richTextBox1.Text = sText
richEditControl1.Text = sText
End Sub
winforms-spreadsheet-how-to-edit-rich-text/VB/SpreadsheetRichText/RichTextEditForm.vb#L46
Else
RichEditControl1.Text = cell.DisplayText
End If
See Also