System.Windows.Forms.CommonDialog.ShowDialog Method

Runs a common dialog box with the specified owner.

Syntax

public DialogResult ShowDialog (IWin32Window owner)

Parameters

owner
Any object that implements System.Windows.Forms.IWin32Window that represents the top-level window that will own the modal dialog box.

Returns

DialogResult.OK if the user clicks OK in the dialog box; otherwise, DialogResult.Cancel.

Remarks

This version of the CommonDialog.ShowDialog method allows you to specify a specific form or control that will own the dialog box that is shown. If you use the version of this method that has no parameters, the dialog box being shown would be owned automatically by the currently active window of your application.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0