CommonDialog.ShowDialog CommonDialog.ShowDialog CommonDialog.ShowDialog CommonDialog.ShowDialog Method

Definition

Displays a common dialog.

Overloads

ShowDialog() ShowDialog() ShowDialog() ShowDialog()

Displays a common dialog.

ShowDialog(Window) ShowDialog(Window) ShowDialog(Window) 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() ShowDialog() ShowDialog() ShowDialog()

Displays a common dialog.

public:
 virtual Nullable<bool> ShowDialog();
[System.Security.SecurityCritical]
public virtual Nullable<bool> ShowDialog ();
abstract member ShowDialog : unit -> Nullable<bool>
override this.ShowDialog : unit -> Nullable<bool>
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.

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.

Security

UIPermission
to execute this method without raising of an exception. Associated enumeration: AllWindows

ShowDialog(Window) ShowDialog(Window) ShowDialog(Window) ShowDialog(Window)

Displays a common dialog.

public:
 Nullable<bool> ShowDialog(System::Windows::Window ^ owner);
[System.Security.SecurityCritical]
public Nullable<bool> ShowDialog (System.Windows.Window owner);
member this.ShowDialog : System.Windows.Window -> Nullable<bool>
Public Function ShowDialog (owner As Window) As Nullable(Of Boolean)
Parameters
owner
Window Window Window 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.

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.

Security

UIPermission
to execute this method without raising of an exception. Associated enumeration: AllWindows

See Also

Applies to