Intersoft ClientUI Documentation
ShowDialog Method
See Also  Example Send Feedback
Intersoft.Client.UI.Aqua.UXDesktop Namespace > UXDialogBox Class : ShowDialog Method






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.
Show the dialog box to the foreground window.

Syntax

Visual Basic (Declaration) 
Public Sub ShowDialog( _
   ByVal owner As IWindow, _
   ByVal closeCallback As Action(Of DialogResult) _
) 
Visual Basic (Usage)Copy Code
Dim instance As UXDialogBox
Dim owner As IWindow
Dim closeCallback As Action(Of DialogResult)
 
instance.ShowDialog(owner, closeCallback)
C# 
public void ShowDialog( 
   IWindow owner,
   Action<DialogResult> closeCallback
)
Delphi 
public procedure ShowDialog( 
    owner: IWindow;
    closeCallback: Action
); 
JScript 
public function ShowDialog( 
   owner : IWindow,
   closeCallback : Action
);
Managed Extensions for C++ 
public: void ShowDialog( 
   IWindow* owner,
   Action<DialogResult>* closeCallback
) 
C++/CLI 
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.
C#Copy 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.
C#Copy Code
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 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.