Displays a message window, also known as a dialog box, which presents a message to the user. It is a modal window, blocking other actions in the application until the user closes it. A message_dialog can contain text, buttons, and symbols that inform and instruct the user.
| Windows | macOS | Gnome | |
|---|---|---|---|
| Light |   
 |   
 |   
 | 
| Dark |   
 |   
 |   
 | 
Public Events | |
| event< message_dialog, help_event_handler > | help_request | 
| Occurs when the user clicks the Help button on a common dialog box.   | |
| event< message_dialog, dialog_closed_event_handler > | dialog_closed | 
| Occurs when the user close a message dialog box with dialog close button or other dialog buttons.   | |
Public Constructors | |
| message_dialog () | |
| Initializes a new instance of the message_dialog class.   | |
Public Properties | |
| xtd::forms::message_dialog_buttons | buttons () const noexcept | 
| Gets buttons to display in the message dialog.   | |
| message_dialog & | buttons (xtd::forms::message_dialog_buttons buttons) | 
| Sets buttons to display in the message dialog.   | |
| xtd::forms::message_dialog_default_button | default_button () const noexcept | 
| Gets default button for the message dialog.   | |
| message_dialog & | default_button (xtd::forms::message_dialog_default_button default_button) | 
| Sets default button for the message dialog.   | |
| bool | display_help_button () const noexcept | 
| Gets a value indicate if help button is shown.   | |
| message_dialog & | display_help_button (bool display_help_button) | 
| Sets a value indicate if help button is shown.   | |
| xtd::forms::dialog_result | dialog_result () const noexcept | 
| Gets async dialog_result result after dialog box is closing.   | |
| xtd::forms::dialog_appearance | dialog_appearance () const noexcept | 
| Gets the dialog appearance.   | |
| message_dialog & | dialog_appearance (xtd::forms::dialog_appearance dialog_appearance) | 
| Sets the dialog appearance.   | |
| xtd::forms::message_dialog_icon | icon () const noexcept | 
| Gets icon to display in the message dialog.   | |
| message_dialog & | icon (xtd::forms::message_dialog_icon icon) | 
| Sets icon to display in the message dialog.   | |
| xtd::forms::message_dialog_options | options () const noexcept | 
| Gets options will be used for the message box.   | |
| message_dialog & | options (xtd::forms::message_dialog_options options) | 
| Sets options will be used for the message box.   | |
| xtd::string | message () const noexcept | 
| Gets the text message.   | |
| message_dialog & | message (const xtd::string &message) | 
| Sets the text message.   | |
| xtd::string | text () const noexcept | 
| Gets the dialog caption text.   | |
| message_dialog & | text (const xtd::string &text) | 
| Sets the dialog caption text.   | |
Public Methods | |
| void | reset () | 
| Resets all properties to empty string.   | |
| xtd::forms::dialog_result | show_dialog () | 
| Runs message dialog box.   | |
| xtd::forms::dialog_result | show_dialog (const iwin32_window &owner) | 
| Runs message dialog box.   | |
| void | show_sheet (const iwin32_window &owner) | 
| Runs message dialog box.   | |
| xtd::forms::dialog_result | show_sheet_dialog (const iwin32_window &owner) | 
| Runs message dialog box.   | |
Additional Inherited Members | |
  Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object.   | |
| virtual bool | equals (const object &obj) const noexcept | 
| Determines whether the specified object is equal to the current object.   | |
| virtual size_t | get_hash_code () const noexcept | 
| Serves as a hash function for a particular type.   | |
| virtual type_object | get_type () const noexcept | 
| Gets the type of the current instance.   | |
| template<typename object_t > | |
| xtd::uptr< object_t > | memberwise_clone () const | 
| Creates a shallow copy of the current object.   | |
| virtual xtd::string | to_string () const noexcept | 
| Returns a xtd::string that represents the current object.   | |
  Static Public Member Functions inherited from xtd::object | |
| template<typename object_a_t , typename object_b_t > | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept | 
| Determines whether the specified object instances are considered equal.   | |
| template<typename object_a_t , typename object_b_t > | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept | 
| Determines whether the specified object instances are the same instance.   | |
  Protected Member Functions inherited from xtd::forms::component | |
| component () | |
| Initialises a new instance of the component class.   | |
| virtual bool | can_raise_events () const noexcept | 
| Gets a value indicating whether the component can raise an event.   | |
| bool | design_mode () const noexcept | 
| Gets a value that indicates whether the component is currently in design mode.   | |
| xtd::forms::message_dialog::message_dialog | ( | ) | 
Initializes a new instance of the message_dialog class.
      
  | 
  noexcept | 
Gets buttons to display in the message dialog.
| message_dialog & xtd::forms::message_dialog::buttons | ( | xtd::forms::message_dialog_buttons | buttons | ) | 
Sets buttons to display in the message dialog.
| buttons | One of the xtd::forms::message_dialog_buttons values that specifies which buttons to display in the message dialog. | 
      
  | 
  noexcept | 
Gets default button for the message dialog.
| message_dialog & xtd::forms::message_dialog::default_button | ( | xtd::forms::message_dialog_default_button | default_button | ) | 
Sets default button for the message dialog.
| default_button | One of the xtd::forms::message_dialog_default_button values that specifies the default button for the message dialog. | 
      
  | 
  noexcept | 
Gets a value indicate if help button is shown.
| message_dialog & xtd::forms::message_dialog::display_help_button | ( | bool | display_help_button | ) | 
Sets a value indicate if help button is shown.
| display_help_button | true to show the Help button; otherwise, false. The default is false. | 
      
  | 
  noexcept | 
Gets async dialog_result result after dialog box is closing.
      
  | 
  noexcept | 
Gets the dialog appearance.
| message_dialog & xtd::forms::message_dialog::dialog_appearance | ( | xtd::forms::dialog_appearance | dialog_appearance | ) | 
Sets the dialog appearance.
| dialog_appearance | One of the xtd::forms::dialog_appearance values. The default value is xtd::forms::dialog_appearance::standard. | 
      
  | 
  noexcept | 
Gets icon to display in the message dialog.
| message_dialog & xtd::forms::message_dialog::icon | ( | xtd::forms::message_dialog_icon | icon | ) | 
Sets icon to display in the message dialog.
| icon | One of the xtd::forms::message_dialog_icon values that specifies which icon to display in the message dialog. | 
      
  | 
  noexcept | 
Gets options will be used for the message box.
| message_dialog & xtd::forms::message_dialog::options | ( | xtd::forms::message_dialog_options | options | ) | 
Sets options will be used for the message box.
| options | One of the xtd::forms::message_dialog_options 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. | 
      
  | 
  noexcept | 
Gets the text message.
| message_dialog & xtd::forms::message_dialog::message | ( | const xtd::string & | message | ) | 
      
  | 
  noexcept | 
Gets the dialog caption text.
| message_dialog & xtd::forms::message_dialog::text | ( | const xtd::string & | text | ) | 
Sets the dialog caption text.
| text | The new dialog caption text. | 
| void xtd::forms::message_dialog::reset | ( | ) | 
Resets all properties to empty string.
| xtd::forms::dialog_result xtd::forms::message_dialog::show_dialog | ( | ) | 
Runs message dialog box.
| xtd::forms::dialog_result xtd::forms::message_dialog::show_dialog | ( | const iwin32_window & | owner | ) | 
Runs message dialog box.
| void xtd::forms::message_dialog::show_sheet | ( | const iwin32_window & | owner | ) | 
Runs message dialog box.
| xtd::forms::dialog_result xtd::forms::message_dialog::show_sheet_dialog | ( | const iwin32_window & | owner | ) | 
Runs message dialog box.
| event<message_dialog, help_event_handler> xtd::forms::message_dialog::help_request | 
Occurs when the user clicks the Help button on a common dialog box.
| event<message_dialog, dialog_closed_event_handler> xtd::forms::message_dialog::dialog_closed | 
Occurs when the user close a message dialog box with dialog close button or other dialog buttons.