Edit

Share via


TaskDialog.ShowDialogAsync Method

Definition

Overloads

ShowDialogAsync(TaskDialogPage, TaskDialogStartupLocation)

Shows the task dialog with the specified owner asynchronously.

ShowDialogAsync(IntPtr, TaskDialogPage, TaskDialogStartupLocation)

Shows the task dialog with the specified owner asynchronously.

ShowDialogAsync(IWin32Window, TaskDialogPage, TaskDialogStartupLocation)

Shows the task dialog with the specified owner asynchronously.

ShowDialogAsync(TaskDialogPage, TaskDialogStartupLocation)

Source:
TaskDialog.cs

Shows the task dialog with the specified owner asynchronously.

C#
[System.Diagnostics.CodeAnalysis.Experimental("WFO5002", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public static System.Threading.Tasks.Task<System.Windows.Forms.TaskDialogButton> ShowDialogAsync(System.Windows.Forms.TaskDialogPage page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterScreen);

Parameters

page
TaskDialogPage

The page instance that contains the contents which this task dialog will display.

startupLocation
TaskDialogStartupLocation

Gets or sets the position of the task dialog when it is shown.

Returns

The TaskDialogButton which was clicked by the user to close the dialog.

Attributes

Exceptions

page is null.

The specified page contains an invalid configuration.

Remarks

Showing the dialog will bind the page and its controls until this method returns or the dialog is navigated to a different page.

Applies to

Windows Desktop 10 and Windows Desktop 9
Product Versions
Windows Desktop 9, 10

ShowDialogAsync(IntPtr, TaskDialogPage, TaskDialogStartupLocation)

Source:
TaskDialog.cs

Shows the task dialog with the specified owner asynchronously.

C#
[System.Diagnostics.CodeAnalysis.Experimental("WFO5002", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public static System.Threading.Tasks.Task<System.Windows.Forms.TaskDialogButton> ShowDialogAsync(IntPtr hwndOwner, System.Windows.Forms.TaskDialogPage page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner);

Parameters

hwndOwner
IntPtr

The handle of the owner window, or Zero to show a modeless dialog.

page
TaskDialogPage

The page instance that contains the contents which this task dialog will display.

startupLocation
TaskDialogStartupLocation

The position of the task dialog when it is shown.

Returns

The TaskDialogButton which was clicked by the user to close the dialog.

Attributes

Exceptions

page is null.

The specified page contains an invalid configuration.

Remarks

Showing the dialog will bind the page and its controls until this method returns or the dialog is navigated to a different page.

Applies to

Windows Desktop 10 and Windows Desktop 9
Product Versions
Windows Desktop 9, 10

ShowDialogAsync(IWin32Window, TaskDialogPage, TaskDialogStartupLocation)

Source:
TaskDialog.cs

Shows the task dialog with the specified owner asynchronously.

C#
[System.Diagnostics.CodeAnalysis.Experimental("WFO5002", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public static System.Threading.Tasks.Task<System.Windows.Forms.TaskDialogButton> ShowDialogAsync(System.Windows.Forms.IWin32Window owner, System.Windows.Forms.TaskDialogPage page, System.Windows.Forms.TaskDialogStartupLocation startupLocation = System.Windows.Forms.TaskDialogStartupLocation.CenterOwner);

Parameters

owner
IWin32Window

The owner window.

page
TaskDialogPage

The page instance that contains the contents which this task dialog will display.

startupLocation
TaskDialogStartupLocation

The position of the task dialog when it is shown.

Returns

The TaskDialogButton which was clicked by the user to close the dialog.

Attributes

Exceptions

page is null.

The specified page contains an invalid configuration.

Remarks

Showing the dialog will bind the page and its controls until this method returns or the dialog is navigated to a different page.

Applies to

Windows Desktop 10 and Windows Desktop 9
Product Versions
Windows Desktop 9, 10