How to Clear content in RichEditControl
By FoxLearn 8/30/2024 2:44:32 AM 118
If you're working with RichEditControl from DevExpress in a C# WinForms application, you can clear its content in a straightforward way.
How to clear content in RichEditControl
Depending on your specific needs, you might use other methods.
You can clear Text Using RichEditControl.Text
Property as shown below.
richEditControl1.Text = string.Empty;
Clearing Content in RichEditControl
(DevExpress)
To clear the content of a RichEditControl
, You can invoke the RichEditControl.Document.Delete
method as shown below.
// Assuming richEditControl1 is your RichEditControl richEditControl1.Document.Delete(richEditControl1.Document.Range);
This approach results in clearing a current document content only.
If you want to clear the content of a RichEditControl
while also removing all custom styles, you can use the CreateNewDocument
method.
// Reset the document, clearing content and removing custom styles richEditControl1.CreateNewDocument();
- How to Download and Install DevExpress
- How to use DevExpress Themes/Skins in C#
- How to use Ribbon Control in C#
- How to use DevExpress Project Converter
- How to get icons from the DX Image Gallery
- How to set default font for RichEditControl
- How to use CheckedComboBoxEdit with SearchControl in C#
- How to Create a Radial Menu in C#
Categories
Popular Posts
Spica Admin Dashboard Template
11/18/2024