ModulePage.ShowMessage Method

Definition

Displays a message box that is parented to the top-most window.

Overloads

ShowMessage(String, MessageBoxButtons, MessageBoxIcon)

Displays a message box that is parented to the top-most window, using the specified text, button set, and icon.

ShowMessage(String, String)

Displays a message box that is parented to the top-most window, using the specified text and caption.

ShowMessage(String)

Displays a message box that is parented to the top-most window, using the specified text.

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, and default button.

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, String)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, and caption.

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, String)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, default button, and caption.

ShowMessage(String, MessageBoxButtons, MessageBoxIcon)

Displays a message box that is parented to the top-most window, using the specified text, button set, and icon.

protected:
 System::Windows::Forms::DialogResult ShowMessage(System::String ^ text, System::Windows::Forms::MessageBoxButtons buttons, System::Windows::Forms::MessageBoxIcon icon);
protected System.Windows.Forms.DialogResult ShowMessage (string text, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon);
member this.ShowMessage : string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon -> System.Windows.Forms.DialogResult
Protected Function ShowMessage (text As String, buttons As MessageBoxButtons, icon As MessageBoxIcon) As DialogResult

Parameters

text
String

The message to display.

buttons
MessageBoxButtons

The MessageBoxButtons object to display.

icon
MessageBoxIcon

The MessageBoxIcon object to display.

Returns

One of the DialogResult values that indicates the selected button.

Examples

The following example displays a message dialog box.

DialogResult dr = ShowMessage("MyMessage",
    MessageBoxButtons.AbortRetryIgnore,
    MessageBoxIcon.Hand
);
if (dr == DialogResult.Abort)
    InitiateShutdownSequence("0001");

Remarks

The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to

ShowMessage(String, String)

Displays a message box that is parented to the top-most window, using the specified text and caption.

protected:
 void ShowMessage(System::String ^ text, System::String ^ caption);
protected void ShowMessage (string text, string caption);
member this.ShowMessage : string * string -> unit
Protected Sub ShowMessage (text As String, caption As String)

Parameters

text
String

The message to display.

caption
String

The caption for the title bar.

Examples

The following example displays a message dialog box.

ShowMessage("MyMessage", "My caption");

Remarks

The message box displays with the information icon.

Applies to

ShowMessage(String)

Displays a message box that is parented to the top-most window, using the specified text.

protected:
 void ShowMessage(System::String ^ text);
protected void ShowMessage (string text);
member this.ShowMessage : string -> unit
Protected Sub ShowMessage (text As String)

Parameters

text
String

The message to display.

Examples

The following example displays a message dialog box.

ShowMessage("MyMessage");

Remarks

The message box displays with the information icon. The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, and default button.

protected:
 System::Windows::Forms::DialogResult ShowMessage(System::String ^ text, System::Windows::Forms::MessageBoxButtons buttons, System::Windows::Forms::MessageBoxIcon icon, System::Windows::Forms::MessageBoxDefaultButton defaultButton);
protected System.Windows.Forms.DialogResult ShowMessage (string text, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton);
member this.ShowMessage : string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton -> System.Windows.Forms.DialogResult
Protected Function ShowMessage (text As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButton As MessageBoxDefaultButton) As DialogResult

Parameters

text
String

The message to display.

buttons
MessageBoxButtons

The MessageBoxButtons object to display.

icon
MessageBoxIcon

The MessageBoxIcon object to display.

Returns

One of the DialogResult values that indicates the selected button.

Examples

The following example displays a message dialog box.

DialogResult dr = ShowMessage("MyMessage",
    MessageBoxButtons.AbortRetryIgnore,
    MessageBoxIcon.Hand,
    MessageBoxDefaultButton.Button1
);
if (dr == DialogResult.Abort)
    InitiateShutdownSequence("0001");

Remarks

The dialog box caption is the title parameter from the Microsoft.Web.Management.Client.ModulePageInfo.ModulePageInfo constructor.

Applies to

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, String)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, and caption.

protected:
 System::Windows::Forms::DialogResult ShowMessage(System::String ^ text, System::Windows::Forms::MessageBoxButtons buttons, System::Windows::Forms::MessageBoxIcon icon, System::String ^ caption);
protected System.Windows.Forms.DialogResult ShowMessage (string text, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, string caption);
member this.ShowMessage : string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * string -> System.Windows.Forms.DialogResult
Protected Function ShowMessage (text As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, caption As String) As DialogResult

Parameters

text
String

The message to display.

buttons
MessageBoxButtons

The MessageBoxButtons object to display.

icon
MessageBoxIcon

The MessageBoxIcon to display.

caption
String

The caption for the title bar.

Returns

One of the DialogResult values that indicates the selected button.

Examples

The following example displays a message dialog box.

DialogResult dr = ShowMessage("MyMessage",
    MessageBoxButtons.AbortRetryIgnore,
    MessageBoxIcon.Hand,
    "My title bar title"
);
if (dr == DialogResult.Abort)
    InitiateShutdownSequence("0001");

Applies to

ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, String)

Displays a message box that is parented to the top-most window, using the specified text, button set, icon, default button, and caption.

protected:
 System::Windows::Forms::DialogResult ShowMessage(System::String ^ text, System::Windows::Forms::MessageBoxButtons buttons, System::Windows::Forms::MessageBoxIcon icon, System::Windows::Forms::MessageBoxDefaultButton defaultButton, System::String ^ caption);
protected System.Windows.Forms.DialogResult ShowMessage (string text, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, string caption);
member this.ShowMessage : string * System.Windows.Forms.MessageBoxButtons * System.Windows.Forms.MessageBoxIcon * System.Windows.Forms.MessageBoxDefaultButton * string -> System.Windows.Forms.DialogResult
Protected Function ShowMessage (text As String, buttons As MessageBoxButtons, icon As MessageBoxIcon, defaultButton As MessageBoxDefaultButton, caption As String) As DialogResult

Parameters

text
String

The message to display.

buttons
MessageBoxButtons

The MessageBoxButtons object to display.

icon
MessageBoxIcon

The MessageBoxIcon object to display.

caption
String

The caption for the title bar.

Returns

One of the DialogResult values that indicates the selected button.

Examples

The following example displays a message dialog box.

DialogResult dr = ShowMessage("MyMessage",
    MessageBoxButtons.AbortRetryIgnore,
    MessageBoxIcon.Hand,
    MessageBoxDefaultButton.Button1,
    "My title bar title"
);
if (dr == DialogResult.Abort)
    InitiateShutdownSequence("0001");

Applies to