Intersoft ClientUI Documentation
Show(IWindow,String,String,MessageBoxButton,MessageBoxImage,Action<DialogResult>) Method
See Also  Example Send Feedback
Intersoft.Client.UI.Aqua.UXDesktop Namespace > UXMessageBox Class > Show Method : Show(IWindow,String,String,MessageBoxButton,MessageBoxImage,Action<DialogResult>) Method






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.
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

Visual Basic (Declaration) 
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) _
) 
Visual Basic (Usage)Copy Code
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)
C# 
public static void Show( 
   IWindow window,
   string message,
   string caption,
   MessageBoxButton button,
   MessageBoxImage image,
   Action<DialogResult> resultCallback
)
Delphi 
public procedure Show( 
    window: IWindow;
    message: String;
    caption: String;
    button: MessageBoxButton;
    image: MessageBoxImage;
    resultCallback: Action
); static; 
JScript 
public static function Show( 
   window : IWindow,
   message : String,
   caption : String,
   button : MessageBoxButton,
   image : MessageBoxImage,
   resultCallback : Action
);
Managed Extensions for C++ 
public: static void Show( 
   IWindow* window,
   string* message,
   string* caption,
   MessageBoxButton button,
   MessageBoxImage image,
   Action<DialogResult>* resultCallback
) 
C++/CLI 
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.
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
            }
        }
    );
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.