Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.
Corresponds to the MsgBox action.
App.MsgBox(Prompt, Title[, Icon][, Button])
Newlook Smartclient
Newlook Server
Prompt - (String, Required)
String expression displayed as the message in the dialog box.
Title - (String, Required)
String expression displayed in the title bar of the dialog box.
Icons - (Integer, Optional)
Integer expression that specifies the icon to be displayed in the body of the message box.
It should be one of the pre-defined Icon constants. If omitted, no icon will be displayed.
Buttons - (Integer, Optional)
Integer expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box.
It should be one of the predefined Button constants. If omitted, the default value for buttons is nlMsgOKOnly.
The MsgBox method returns an integer that identifies which button was clicked by the user to close the message box. The return value will be one of the pre-defined Result constants.
The following examples retrieves a global Newlook variable called varUser and then displays it within a message box and executes some logic depending on what button the user pressed to close the window. VB SCRIPTvarDemoVar = app.GetValue("varUser") varConf = App.MsgBox ("Confirm username: " & varDemoVar,"User Name Confirmation",nlMsgQuestion,nlMsgYesNo)
If varConf = nlMsgYes then App.MsgBox "Username confirmed", "Confirmation", nlMsgExclamation, nlMsgOKOnly Else App.MsgBox "Please log off and re-enter username", "Alert", nlMsgCritical, nlMsgOKOnly End if JSCRIPTvarDemoVar = app.GetValue("varUser"); varConf = App.MsgBox ("Confirm username: " + varDemoVar,"User Name Confirmation", nlMsgQuestion, nlMsgYesNo);
if (varConf == nlMsgYes) App.MsgBox ("Username confirmed", "Confirmation"); else App.MsgBox ("Please log off and re-enter username", "Alert"); |
MsgBox action | InputBox method | SetValue method
© 2004-2021 looksoftware. All rights reserved.