## wxMessageDialog

This class represents a dialog that shows a single or multi-line message, with a choice of OK, Yes, No and Cancel buttons.

Derived from

wxDialog
wxWindow
wxEvtHandler
wxObject

Include files

<wx/msgdlg.h>

See also

wxMessageDialog overview

Members

wxMessageDialog::wxMessageDialog
wxMessageDialog::~wxMessageDialog
wxMessageDialog::ShowModal

### wxMessageDialog::wxMessageDialog

wxMessageDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Message box", long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition)

Constructor. Use wxMessageDialog::ShowModal to show the dialog.

Parameters

parent

Parent window.

message

Message to show on the dialog.

caption

The dialog caption.

style

A dialog style (bitlist) containing flags chosen from the following:

wxOK | Show an OK button.
wxCANCEL | Show a Cancel button.
wxYES_NO | Show Yes and No buttons.
wxYES_DEFAULT | Used with wxYES_NO, makes Yes button the default - which is the default behaviour.
wxNO_DEFAULT | Used with wxYES_NO, makes No button the default.
wxCENTRE | Centre the message. Not Windows.
wxICON_EXCLAMATION | Shows an exclamation mark icon.
wxICON_HAND | Shows a hand icon.
wxICON_QUESTION | Shows a question mark icon.
wxICON_INFORMATION | Shows an information (i) icon.

pos

Dialog position. Not Windows.

### wxMessageDialog::~wxMessageDialog

~wxMessageDialog()

Destructor.

### wxMessageDialog::ShowModal

int ShowModal()

Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, wxID_NO.