Skip to main content

RichEditControl.DocumentClosing Event

Occurs when a document that contains unsaved changes is about to be closed.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v23.2.dll

NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.RichEdit, DevExpress.Win.TreeMap


public event CancelEventHandler DocumentClosing

Event Data

The DocumentClosing event's data class is CancelEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.


Handle the DocumentClosing event to specify the actions to perform before the document is closed. To cancel closing, set the e.Cancel value to true.

The DocumentClosing event is raised only if the document has unsaved changes (that is, if the RichEditControl.Modified property is true).

The event is raised when the following commands and methods are executed:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DocumentClosing event.


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