Aracılığıyla paylaş


MessageDialog Constructors

Definition

Overloads

MessageDialog(String)

Initializes a new instance of the MessageDialog class to display an untitled message dialog that can be used to ask your user simple questions.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

The dialog dims the screen behind it and blocks touch events from passing to the app's canvas until the user responds.

Message dialogs should be used sparingly, and only for critical messages or simple questions that must block the user's flow.

MessageDialog(String, String)

Initializes a new instance of the MessageDialog class to display a titled message dialog that can be used to ask your user simple questions.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

MessageDialog(String)

Initializes a new instance of the MessageDialog class to display an untitled message dialog that can be used to ask your user simple questions.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

The dialog dims the screen behind it and blocks touch events from passing to the app's canvas until the user responds.

Message dialogs should be used sparingly, and only for critical messages or simple questions that must block the user's flow.

public:
 MessageDialog(Platform::String ^ content);
 MessageDialog(winrt::hstring const& content);
public MessageDialog(string content);
function MessageDialog(content)
Public Sub New (content As String)

Parameters

content
String

Platform::String

winrt::hstring

The message displayed to the user.

Remarks

When localizing the content of a message dialog with string resources (WinJS.Resources), the lang property returned by the getString method is applied by the MessageDialog constructor automatically. You cannot specify this property in the constructor.

See also

Applies to

MessageDialog(String, String)

Initializes a new instance of the MessageDialog class to display a titled message dialog that can be used to ask your user simple questions.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

public:
 MessageDialog(Platform::String ^ content, Platform::String ^ title);
 MessageDialog(winrt::hstring const& content, winrt::hstring const& title);
public MessageDialog(string content, string title);
function MessageDialog(content, title)
Public Sub New (content As String, title As String)

Parameters

content
String

Platform::String

winrt::hstring

The message displayed to the user.

title
String

Platform::String

winrt::hstring

The title you want displayed on the dialog.

Remarks

When localizing the content of a message dialog with string resources (WinJS.Resources), the lang property returned by the getString method is applied by the MessageDialog constructor automatically. You cannot specify this property in the constructor.

See also

Applies to