Displays a message box with the specified text, caption, buttons, icon, and default button.
| C# | Visual Basic |
public static DialogResult Show( string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton )
Public Shared Function Show ( _ text As String, _ caption As String, _ buttons As MessageBoxButtons, _ icon As MessageBoxIcon, _ defaultButton As MessageBoxDefaultButton _ ) As DialogResult
- text (String)
- The text to display in the message box.
- caption (String)
- The text to display in the title bar of the message box.
- buttons (MessageBoxButtons)
- One of the MessageBoxButtons values that specifies which buttons to display in the message box.
- icon (MessageBoxIcon)
- One of the MessageBoxIcon values that specifies which icon to display in the message box.
- defaultButton (MessageBoxDefaultButton)
- One of the MessageBoxDefaultButton values that specifies the default button for the message box.
One of the DialogResult values.