dxMessageBox(string,string,Integer) Method
Invokes a modal message dialog box.
Declaration
function dxMessageBox(const AMessage: string; const ATitle: string; AFlags: Integer): Integer;
Parameters
Name | Type | Description |
---|---|---|
AMessage | string | Message dialog box content. The The |
ATitle | string | A message dialog box caption. You can pass an empty string as the |
AFlags | Integer | A combination of flags that define available UI elements and message dialog box behavior. Refer to the list of supported flags in the Remarks section. |
Returns
Type | Description |
---|---|
Integer | An integer value that indicates the button clicked to close the message box. The Refer to the list of possible return values in the Remarks section. |
Remarks
Call the dxMessageBox
function to invoke a generic dialog box with a message and one or more buttons. The created message dialog box has the mdsMessageBox style.
Supported BBCode-Inspired Markup Tags
Text Formatting Attribute | Message Text with Tags | Example |
---|---|---|
Bold | '[B]DevExpress[/B]' |
|
Italic | '[I]DevExpress[/I]' |
|
Underscore | '[U]DevExpress[/U]' |
|
Strikeout | '[S]DevExpress[/S]' |
|
Subscript | 'Dev[Sub]Express[/Sub]' |
|
Superscript | 'Dev[Sup]Express[/Sup]' |
|
Custom Font | 'Dev[U][Font=Consolas][Size=12]Express[/U][/Font][/Size]' |
|
Color | '[Color=#E67E22]Dev[/Color][Color=Gray]Express[/Color]' |
|
Background Color | '[BackColor=Orange]DevExpress[/BackColor]' |
|
Hyperlink | '[URL=http://www.devexpress.com/]DevExpress[/URL]' |
|
No Parse | '[NOPARSE][B]DevExpress[/B][/NOPARSE]' |
Code Example
The following code example displays a message box with the predefined “Error” caption, an OK button, and an error icon:
uses dxMessageDialog;
// ...
dxMessageBox('Invalid operation!', '', MB_OK or MB_ICONERROR);
Supported Flags
- MB_OK
- The message box has only the OK button.
- MB_RETRYCANCEL
- The message box has two buttons: Retry and Cancel.
- MB_YESNO
- The message box has two buttons: Yes and No.
- MB_YESNOCANCEL
- The message box has three buttons: Yes, No, and Cancel.
- MB_ABORTRETRYIGNORE
- The message box has three buttons: Abort, Retry, and Ignore.
- MB_OKCANCEL
- The message box has two buttons: OK and Cancel.
- MB_DEFBUTTON1
- Explicitly defines the first button as default. The first button is default unless the
MB_DEFBUTTON2
,MB_DEFBUTTON3
, orMB_DEFBUTTON4
flag is set. - MB_DEFBUTTON2
- Sets the second button as default.
- MB_DEFBUTTON3
- Sets the third button as default.
- MB_DEFBUTTON4
- Sets the fourth button as default.
- MB_ICONWARNING or MB_ICONEXCLAMATION
- The message box displays an exclamation sign icon.
- MB_ICONERROR, MB_ICONHAND, or MB_ICONSTOP
- The message box displays a stop sign button.
- MB_ICONINFORMATION or MB_ICONASTERISK
- The message box displays the icon that consists of a lowercase
i
in a circle. - MB_ICONQUESTION
- The message box displays a question sign icon.
- MB_RTLREADING
- The message box changes the direction of message and caption text to right-to-left.
- MB_TOPMOST
- The message box has the
WS_EX_TOPMOST
window style.
Returned Values
- IDOK
- A user clicked the OK button to close the message box.
- IDCANCEL
- A user clicked the Cancel button to close the message box.
- IDABORT
- A user clicked the Abort button to close the message box.
- IDRETRY
- A user clicked the Retry button to close the message box.
- IDIGNORE
- A user clicked the Ignore button to close the message box.
- IDYES
- A user clicked the Yes button to close the message box.
- IDNO
- A user clicked the No button to close the message box.