Intersoft ClientUI Documentation
Show(IWindow,String,String,MessageBoxButton,MessageBoxImage,Action<DialogResult>) Method
Example 



A Window that represents the owner window of the message box.
A String that specifies the text to display.
A String that specifies the title bar caption to display.
A MessageBoxButton value that specifies which button or buttons to display.
A MessageBoxImage value that specifies the icon to display.
An Action delegate that will be called when the message box is closed.
Displays a message box in front of the specified window. The message box displays a message, title bar caption, button and icon; and it also returns a result.
Syntax
Public Overloads Shared Sub Show( _
   ByVal window As IWindow, _
   ByVal message As String, _
   ByVal caption As String, _
   ByVal button As MessageBoxButton, _
   ByVal image As MessageBoxImage, _
   ByVal resultCallback As Action(Of DialogResult) _
) 
Dim window As IWindow
Dim message As String
Dim caption As String
Dim button As MessageBoxButton
Dim image As MessageBoxImage
Dim resultCallback As Action(Of DialogResult)
 
UXMessageBox.Show(window, message, caption, button, image, resultCallback)
public static void Show( 
   IWindow window,
   string message,
   string caption,
   MessageBoxButton button,
   MessageBoxImage image,
   Action<DialogResult> resultCallback
)
public:
static void Show( 
   IWindow^ window,
   String^ message,
   String^ caption,
   MessageBoxButton button,
   MessageBoxImage image,
   Action<DialogResult>^ resultCallback
) 

Parameters

window
A Window that represents the owner window of the message box.
message
A String that specifies the text to display.
caption
A String that specifies the title bar caption to display.
button
A MessageBoxButton value that specifies which button or buttons to display.
image
A MessageBoxImage value that specifies the icon to display.
resultCallback
An Action delegate that will be called when the message box is closed.
Example
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.
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
            }
        }
    );
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

UXMessageBox Class
UXMessageBox Members
Overload List
Window and Dialog Boxes Overview

Send Feedback