The MessageBox function shows a standard message box.
Syntax
Integer Global.MessageBox(
String text,
String title = "",
Integer button = MB_OK,
Integer icon = MBI_EXCLAMATION)
String text,
String title = "",
Integer button = MB_OK,
Integer icon = MBI_EXCLAMATION)
Parameters
| text | Text of the message. | Required |
|---|---|---|
| title | Text of the title. | Optional |
| button | The type of buttons. Value list that can be used: MB_OK, MB_OKCANCEL, MB_YESNO, MB_YESNOCANCEL, MB_RETRYCANCEL, MB_ABORTRETRYIGNORE | Optional |
| icon | The icon ID. Value list that can be used: MBI_EXCLAMATION, MBI_INFORMATION, MBI_QUESTION, MBI_STOP | Optional |
Return value
The MessageBox function returns one of the following values:
MBA_OK, MBA_CANCEL, MBA_YES, MBA_NO, MBA_RETRY, MBA_ABORT, MBA_IGNORE
If a message box has a Cancel button, the function returns the MBA_CANCEL value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC has no effect.
Example
switch MessageBox("Are you ok?", "Hi", MB_YESNO, MBI_QUESTION)
case MBA_YES
break
case MBA_NO
break
end
case MBA_YES
break
case MBA_NO
break
end