Function: messageBox
Integer messageBox( String strMessage, String strCaption, [ Integer nType ] ) |
Summary
Shows a message box with given message string and specified choice of buttons and icon.
Remarks
The optional nType parameter can be a combination of none or one item from each of the following groups: Button Layouts: Specifies the type of buttons and their organisation. Value | Description | knMBOK | OK button only | knMBOKCancel | OK and Cancel buttons | knMBYesNo | Yes and No buttons | knMBYesNoCancel | Yes, No and Cancel buttons | knMBRetryCancel | Retry and Cancel buttons | knMBAbortRetryIgnore | Abort, Retry and Ignore buttons | knMBCancelTryContinue | Cancel, Try and Continue buttons | Icon: Displays an image in the left side of the message box. Value | Description | knMBIconExclamation | Displays an exclamation mark or warning symbol | knMBIconInformation | Displays an 'i' information icon | knMBIconQuestion | Displays a question mark | knMBIconStop | Displays a red 'hand' stop sign | Default Button: The default button will be highlighted with a bolder border and is activated when the Return key is pressed. Value | Description | knMBDefault1 | Specifies that the first button in the group is enabled as default | knMBDefault2 | Specifies that the second button in the group is enabled as default | knMBDefault3 | Specifies that the third button in the group is enabled as default | knMBDefault4 | Specifies that the fourth button in the group is enabled as default |
Parameters
Parameter | Description |
String strMessage |
Specifies the message that will be displayed in the message box. This can contain "\n" characters for a new line. |
String strCaption |
Specifies the message box caption title. |
Integer nType [optional] |
Optional value comprising an OR of a value from each of the available groups. |
|
|
|
Returns
Returns a constant specifying the button that was clicked: Value | knMBReturnYes | knMBReturnNo | knMBReturnOK | knMBReturnCancel | knMBReturnAbort | knMBReturnContinue | knMBReturnIgnore | knMBReturnRetry | knMBReturnTryAgain |
Examples
if( messageBox( "This is a simple box.\n\nClick Yes or No.", "Caption", knMBYesNo | knMBIconQuestion | knMBDefault2 ) == knMBReturnYes ) { debugOut( "Button Yes was clicked" ); }
|
See Also
prompt
Requirements
Build 1059
|