Skip to main content

SchedulerControl.CustomizeMessageBoxCaption Event

Allows you to change the caption of a built-in message box that prompts the user for an action after an error condition has occurred.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v23.2.dll

NuGet Package: DevExpress.Win.Scheduler

Declaration

public event CustomizeMessageBoxCaptionEventHandler CustomizeMessageBoxCaption

Event Data

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

Property Description
Caption Gets or sets a string for display in the caption of a message box that prompts the end-user to save appointment changes.
CaptionId Obtains the identifier of a localized string that will be displayed as the message box caption.

Remarks

By default, the message box caption displays the application name. By handling the CustomizeMessageBoxCaption event you can change the caption using the CustomizeMessageBoxCaptionEventArgs.Caption property. The CustomizeMessageBoxCaptionEventArgs.CaptionId property provides you with a localized string displayed in the message box, so you can change the header text according to the text of the message.

Example

This code snippet changes the caption of the dialog displayed on closing the appointment form which contains unsaved changes. The text in the message box is obtained from the localized resources by the SchedulerStringId.Msg_SaveBeforeClose ID.

CustomizeMessageBoxCaption

    scheduler.CustomizeMessageBoxCaption += scheduler_CustomizeMessageBoxCaption;

public static void scheduler_CustomizeMessageBoxCaption(object sender, CustomizeMessageBoxCaptionEventArgs e) {
    if (e.CaptionId == DevExpress.XtraScheduler.Localization.SchedulerStringId.Msg_SaveBeforeClose)
        e.Caption = "Appointment modification";
}
See Also