How to Clear content in RichEditControl
By FoxLearn 8/30/2024 2:44:32 AM 140
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();
Categories
Popular Posts
Material Lite Admin Template
11/14/2024
Freedash bootstrap lite
11/13/2024
RuangAdmin Template
11/17/2024
Responsive Animated Login Form
11/11/2024