Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.
- text
- The text to display in the message box.
- caption
- The text to display in the title bar of the message box.
- buttons
- One of the System.Windows.Forms.MessageBoxButtons values that specifies which buttons to display in the message box.
- icon
- One of the System.Windows.Forms.MessageBoxIcon values that specifies which icon to display in the message box.
- defaultButton
- One of the System.Windows.Forms.MessageBoxDefaultButton values that specifies the default button for the message box.
- options
- One of the System.Windows.Forms.MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.
- displayHelpButton
- true to show the Help button; otherwise, false. The default is false.
One of the System.Windows.Forms.DialogResult values.
A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.
When the user clicks the Help button, the form that owns the message box (or the active form) receives the Control.HelpRequested event. Handle the Control.HelpRequested event to perform custom Help actions.