Back to Devexpress

RichEditControl.MailMergeStarted Event

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-23009c1d.md

latest3.2 KB
Original Source

RichEditControl.MailMergeStarted Event

Fires before mail merge starts.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public event MailMergeStartedEventHandler MailMergeStarted
vb
Public Event MailMergeStarted As MailMergeStartedEventHandler

Event Data

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

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
DocumentGets a merged document.
OperationDescriptionSpecifies the text displayed by the progress indicator while the document is being rendered.

Remarks

You can handle this event to inform a user that a mail merge has started, since this process can be time consuming. The following code snippet shows that the MailMergeStarted event is used to register a custom service for updating progress indicator on the form.

View Example

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Services;
//...

private void richEditControl1_MailMergeStarted(object sender, MailMergeStartedEventArgs e) {
    richEditControl1.RemoveService(typeof(IProgressIndicationService));
    richEditControl1.AddService(typeof(IProgressIndicationService),
        new MyProgressIndicatorService(richEditControl1, this.progressBarControl1));
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.Services
'...

Private Sub richEditControl1_MailMergeStarted(ByVal sender As Object, ByVal e As MailMergeStartedEventArgs) Handles richEditControl1.MailMergeStarted
    richEditControl1.RemoveService(GetType(IProgressIndicationService))
    richEditControl1.AddService(GetType(IProgressIndicationService), New MyProgressIndicatorService(richEditControl1, Me.progressBarControl1))
End Sub

See Also

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace