Intersoft ClientUI Documentation
ShowDialog Method (UXDialogBox)
Example 



The owner of the dialog box. When specified, the dialog box will appear centered against the owner.
The callback that invoked when the dialog box is closed.
Show the dialog box to the foreground window.
Syntax
Public Sub ShowDialog( _
   ByVal owner As IWindow, _
   ByVal closeCallback As Action(Of DialogResult) _
) 
Dim instance As UXDialogBox
Dim owner As IWindow
Dim closeCallback As Action(Of DialogResult)
 
instance.ShowDialog(owner, closeCallback)
public void ShowDialog( 
   IWindow owner,
   Action<DialogResult> closeCallback
)
public:
void ShowDialog( 
   IWindow^ owner,
   Action<DialogResult>^ closeCallback
) 

Parameters

owner
The owner of the dialog box. When specified, the dialog box will appear centered against the owner.
closeCallback
The callback that invoked when the dialog box is closed.
Example
The following example shows how to display a dialog box in standalone mode using ShowDialog API, and handle the closing callback in the code.
private void UXButton1_Click(object sender, RoutedEventArgs e)
{
    EditDialogBox dialogBox = new EditDialogBox();
    
    dialogBox.ShowDialog(
        
        // show dialog box in standalone mode
        null,

        // callback handler for the close event
        (dialogResult) =>
        {
            if (dialogResult == Intersoft.Client.Framework.DialogResult.OK)
            {
                MessageBox.Show("The dialog box result is OK");
            }
        });
}
The following example explains how to show a dialog box that is attached to a parent window.
private void uXButton1_Click(object sender, RoutedEventArgs e)
{
    EditDialogBox dialogBox = new EditDialogBox();
    UXDesktop currentDesktop = this.GetDesktop();
    
    dialogBox.ShowDialog(
        
        // show dialog box attached to the wndHome.
        currentDesktop.FindWindow("wndHome"),

        // callback handler for the close event
        (dialogResult) =>
        {
            if (dialogResult == Intersoft.Client.Framework.DialogResult.OK)
            {
                MessageBox.Show("The dialog box result is OK");
            }
        });
}
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

UXDialogBox Class
UXDialogBox Members
Window and Dialog Boxes Overview

Send Feedback