Intersoft ClientUI Documentation
How-to: Open a UXMessageBox

This example shows how to open a UXMessageBox.

Example

Description

To show a message box, you use the Show static method of UXMessageBox class. UXMessageBox provides a set of predefined buttons and icons to let you easily show the message box according to specific message type.

The predefined message box buttons contain the following mode:

The following example shows how to use the Show static method to display a message box with predefined buttons and icon, and then handle the closing callback in the code.

Code

C#
Copy Code
private void UXButton2_Click(object sender, RoutedEventArgs e)
{
    UXMessageBox.Show(

        // owner of the message box
        null, 

        // message
        "Do you want to save this document before the application closes?",

        // caption
        "Notepad",

        // predefined buttons
        Intersoft.Client.UI.Aqua.UXDesktop.MessageBoxButton.YesNoCancel,

        // predefined image
        MessageBoxImage.Question,

        // callback handler for the close event
        (dialogResult) =>
        {
            if (dialogResult == Intersoft.Client.Framework.DialogResult.OK)
            {
                // save the document
            }
        }
    );
}
See Also

Concepts

Other Resources