CommonDialog.ShowDialog Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Displays a common dialog.
Overloads
| Name | Description |
|---|---|
| ShowDialog() |
Displays a common dialog. |
| ShowDialog(Window) |
Displays a common dialog. |
Remarks
ShowDialog performs initialization tasks for all common dialogs before calling RunDialog. Since RunDialog requires an owner window, ShowDialog attempts to assign one in the following order of precedence:
The current application's active window.
The current application's parking window.
An internally generated hidden window.
ShowDialog()
Displays a common dialog.
public:
virtual Nullable ShowDialog();
[System.Security.SecurityCritical]
public virtual bool? ShowDialog();
public virtual bool? ShowDialog();
[]
abstract member ShowDialog : unit -> Nullable
override this.ShowDialog : unit -> Nullable
abstract member ShowDialog : unit -> Nullable
override this.ShowDialog : unit -> Nullable
Public Overridable Function ShowDialog () As Nullable(Of Boolean)
Returns
If the user clicks the OK button of the dialog that is displayed (e.g. OpenFileDialog, SaveFileDialog), true is returned; otherwise, false.
- Attributes
Remarks
ShowDialog performs initialization tasks for all common dialogs before calling RunDialog.
In the current implementation, the derived classes (OpenFileDialog and SaveFileDialog) will only return true or false.
Applies to
ShowDialog(Window)
Displays a common dialog.
public:
Nullable ShowDialog(System::Windows::Window ^ owner);
[System.Security.SecurityCritical]
public bool? ShowDialog(System.Windows.Window owner);
public bool? ShowDialog(System.Windows.Window owner);
[]
member this.ShowDialog : System.Windows.Window -> Nullable
member this.ShowDialog : System.Windows.Window -> Nullable
Public Function ShowDialog (owner As Window) As Nullable(Of Boolean)
Parameters
- owner
- Window
Handle to the window that owns the dialog.
Returns
If the user clicks the OK button of the dialog that is displayed (e.g. OpenFileDialog, SaveFileDialog), true is returned; otherwise, false.
- Attributes
Remarks
ShowDialog performs initialization tasks for all common dialogs before calling RunDialog. Additionally, the dialog that is eventually shown is assigned an owner window, which is specified by the owner parameter.
In the current implementation, the derived classes (OpenFileDialog and SaveFileDialog) will only return true or false.