The MsgBoxStyle enumeration values are listed in the following table.
|
Member
|
Value
|
Description
|
| OKOnly | 0 | Displays OK button only. |
| OKCancel | 1 | Displays OK and Cancel buttons. |
| AbortRetryIgnore | 2 | Displays Abort, Retry, and Ignore buttons. |
| YesNoCancel | 3 | Displays Yes, No, and Cancel buttons. |
| YesNo | 4 | Displays Yes and No buttons. |
| RetryCancel | 5 | Displays Retry and Cancel buttons. |
| Critical | 16 | Displays Critical Message icon. |
| Question | 32 | Displays Warning Query icon. |
| Exclamation | 48 | Displays Warning Message icon. |
| Information | 64 | Displays Information Message icon. |
| DefaultButton1 | 0 | First button is default. |
| DefaultButton2 | 256 | Second button is default. |
| DefaultButton3 | 512 | Third button is default. |
| ApplicationModal | 0 | Application is modal. The user must respond to the message box before continuing work in the current application. |
| SystemModal | 4096 | System is modal. All applications are suspended until the user responds to the message box. |
| MsgBoxSetForeground | 65536 | Specifies the message box window as the foreground window. |
| MsgBoxRight | 524288 | Text is right-aligned. |
| MsgBoxRtlReading | 1048576 | Specifies text should appear as right-to-left reading on Hebrew and Arabic systems. |
The first group of values (0–5) describes the number and type of buttons displayed in the dialog box. The second group (16, 32, 48, 64) describes the icon style. The third group (0, 256, 512) determines which button is the default. The fourth group (0, 4096) determines the modality of the message box, and the fifth group specifies whether or not the message box window is the foreground window, along with the alignment and direction of the text. When adding numbers to create a final value for the Buttons argument, use only one number from each group.