How to Clear content in RichEditControl
By Tan Lee Published on Aug 28, 2024 357
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();
- Deserialization from CodeDOM format is unsafe and has been disabled
- How to Download and Install DevExpress
- How to Create a Fluent Design Form in C#
- How to create a SplashScreen in C#
- How to use DevExpress Themes/Skins in C#
- How to use Layout Control in C#
- How to Print Invoice in C#
- How to use Ribbon Control in C#
Categories
Popular Posts
Portal HTML Bootstrap
Nov 13, 2024
Freedash bootstrap lite
Nov 13, 2024
11 Things You Didn't Know About Cloudflare
Dec 19, 2024
How to disable Windows Defender SmartScreen
Dec 24, 2024