Link Search Menu Expand Document

DisplayObject.MessageBox Method

Explanation Display a message box.

An event occurs in response to the button pressed displayed in the message box, and the same value as the event is returned.
Call format obj.MessageBox( message [, title [, flag ] ] )
Return value If you select the OK button, OkSelected is returned.
If you select the Cancel button , CancelSelected is returned.
If you select the Yes button , YesSelected is returned.
If you select the No button , NoSelected is returned.
If you select the Retry button , RetrySelected is returned.
Arguments String message The character string to be displayed in the message box
String title Message box title
intger flag Select the type of button and icon to be displayed in the message box from the following, and specify by adding.
For example, if you want to display the OK button and Cancel button and display the ? Icon, specify as follows.

$ OKCANCEL + $ ICONQUESTION


If the button is omitted, it will be the same as $ OK. If the icon is omitted, it will be the same as $ ICONINFOMATION

Select one button type from the following.
Constant Buttons displayed Events that occur
$ OK OK OkSelected
$ OKCANCEL OK , Cancel OkSelected,
CancelSelected
$ YESNO Yes, No YesSelected,
NoSelected
$ RETRYCANCEL Retry , Cancel RetrySelected,
CancelSelected
$ YESNOCANCEL
Added since
ImageImage
Yes, No, Cancel YesSelected,
NoSelected,
CancelSelected
Select one of the displayed icons from the following.
Constant Icon displayed
$ IconInformation
$ IconQuestion
$ IconExclamation
$ IconStop

You can now specify from 4 types of icons displayed from Mobile Ver.2.0.0.


Select one of the default buttons below.
Constant Description
$ DefButton1 The first button from the left is the default button
$ DefButton2 The second from the left is the default button
$ DefButton3 The third from the left is the default button

Added since Mobile Ver.4.0.0, Mobile Ver.3.0.0

Exception None
Example of use
if (MessageBox("Please confirm", "Confirm", $OKCANCEL) == OkSelected) {
    :
}
    
Related item OkSelected, CancelSelected, YesSelected, NoSelected, RetrySelected events