Skip to main content
A newer version of this page is available. .

Events

  • 2 minutes to read

This document is an overview of the most useful events implemented for the RichEditControl.

Tip

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T258534.

When a new document is created in RichEditControl via the RichEditControl.CreateNewDocument method, the RichEditControl.EmptyDocumentCreated event is raised.

When a document is loaded in RichEditControl, the RichEditControl.DocumentClosing event occurs. It enables you to take the necessary steps before the content of the previously loaded document is discarded. Then, the RichEditControl.BeforeImport event is raised, enabling you to configure the importer; and the RichEditControl.DocumentLoaded event indicates that the loading process is finalized.

The RichEditControl.ContentChanged event indicates changes in the control content, while the RichEditControl.ModifiedChanged event signalizes that the current document is modified and the RichEditControl.Modified property is changed. The ModifiedChanged event does not occur when a document is loaded or saved.

Note

If the loaded document contains fields and the RichEditMailMergeOptions.ViewMergedData is set to true, the fields are automatically updated and the ModifiedChanged event fires.

When a document is saved, the RichEditControl.BeforeExport event occurs, enabling you to customize export settings, e.g. specify the location to store external content when the document is saved in HTML.

A special RichEditControl.UnhandledException event provides an easy-to-use method for processing exceptions, which are not handled by RichEditControl.

Some events are implemented to allow the customization of RichEditControl. The RichEditControl.PopupMenuShowing event allows you to modify a popup menu before it is shown. Numerous *FormShowing events (such as RichEditControl.FontFormShowing, RichEditControl.SearchFormShowing, RichEditControl.HyperlinkFormShowing etc.) enable you to add custom logic or validation to corresponding dialogs. Note that you can create descendants for almost all dialogs and override their methods as required.

User activity can be tracked by such events as RichEditControl.SelectionChanged, RichEditControl.HyperlinkClick, RichEditControl.StartHeaderFooterEditing, RichEditControl.ZoomChanged.

The mail merge process is also accompanied with events - RichEditControl.MailMergeStarted, RichEditControl.MailMergeRecordStarted, RichEditControl.MailMergeRecordFinished, RichEditControl.MailMergeFinished.

Special purpose events are the RichEditControl.AutoCorrect and the RichEditControl.CalculateDocumentVariable.

See Also