tmsgdlgbuttons type

 When we using the message box prompt in Delphi or C++Builder, we will write a code line something like:

if ((Application->MessageBox("Are you sure to delete this datas?", "confirm!", MB_ICONINFORMATION|MB_YESNO)) == ID_YES)
{
    do the delete code here...
}
else
{
    do the do not delete action here...
}

So, this is the message box symbols and with their meanings you would use in Delphi or C++Builder. Following list the TMsgDlgBtn, TMsgDlgButtons type in Delphi.

TMsgDlgButtons defines a set of values used by MessageDlg and MessageDlgPos.

Unit

Dialogs

enum TMsgDlgBtn { mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, mbHelp };
#define mbYesNoCancel (System::Set () << mbYes << mbNo << mbCancel )
#define mbYesNoAllCancel (System::Set () << mbYes <

#define mbOKCancel (System::Set () << mbOK << mbCancel )

#define mbAbortRetryIgnore (System::Set () << mbAbort << mbRetry << mbIgnore )
#define mbAbortIgnore (System::Set () << mbAbort << mbIgnore )

typedef Set TMsgDlgButtons;

Description

The TMsgDlgButtons type defines the set of values a button in a message box can have. The TMsgDlgButtons type is used by the MessageDlg and MessageDlgPos functions. The following tables lists the possible values:

Value Meaning
mbYes A button with "Yes" on its face.
mbNo A button the text "No" on its face.
mbOK A button the text "OK" on its face.
mbCancel A button with the text "Cancel" on its face.
mbAbort A button with the text "Abort" on its face
mbRetry A button with the text "Retry" on its face
mbIgnore A button the text "Ignore" on its face
mbAll A button with the text "All" on its face
mbNoToAll A button with the text "No to All" on its face
mbYesToAll A button with the text "Yes to All" on its face
mbHelp A button with the text "Help" on its face

In addition, the Dialogs unit defines the following constants for commonly used TMsgDlgButtons values:

Constant Meaning
mbYesNoCancel mbYes, mbNo, and mbCancel
mbYesNoAllCancel mbYes, mbYesToAll, mbNo, mbNoToAll, and mbCancel
mbOKCancel mbOK and mbCancel
mbAbortRetryIgnore mbAbort, mbRetry, and mbIgnore
mbAbortIgnore mbAbort, mbIgnore

Note: When using in C++Builder, the character should be written in uppercase.