WizardPage.ShowMessage Method (String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)


Displays a message box that uses the specified text, button set, symbol, and default button.

Namespace:   Microsoft.Web.Management.Client.Win32
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

protected DialogResult ShowMessage(
	string text,
	MessageBoxButtons buttons,
	MessageBoxIcon icon,
	MessageBoxDefaultButton defaultButton


Type: System.String

The message to display in the message box.

Type: System.Windows.Forms.MessageBoxButtons

One of the System.Windows.Forms.MessageBoxButtons values.

Type: System.Windows.Forms.MessageBoxIcon

One of the System.Windows.Forms.MessageBoxIcon values.

Type: System.Windows.Forms.MessageBoxDefaultButton

One of the System.Windows.Forms.MessageBoxDefaultButton values.

This method enables you to create a custom ShowMessage method. You can check the return System.Windows.Forms.DialogResult value from this method to determine the user's actions.

The following example demonstrates the ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton) overload. This example displays a message box that contains Yes and No buttons and an information symbol, and it provides the user an opportunity to cancel the operation. This code example is part of a larger example provided for the WizardPage class.

Return to top