MessageBox - method of the Pm object

Displays the message in the window and waits for the user's click. Returns a value corresponding to the pressed button.
Long MessageBox(String sTitle, String sText, [Long nStyle])
sTitle(String) Text string displayed in the window title bar
sText(String) Text that is displayed in the window. If the text is to including multiple rows then the vbCr, vbLf or vbCrLf constants can be used as separators. In JavaScript language "\n".
nStyle[optional] (Long) Bit flags defining window type and content.
Hexadecimal numbers can be entered by adding a prefix: for JavaScript it is 0x and for VBScript it is &H. For example, 0x10 or &H10 in hexadecimal represents 16 in decimal.
It is possible to enter the following styles or their combinations as a sum:
&H0 / 0x0 (default) - Display only the "OK" button
&H1 / 0x1 - Display the OK and Cancel buttons
&H2 / 0x2 - Display the ABORT, RETRY and IGNORE buttons
&H3 / 0x3 - Display the YES, NO and Cancel buttons
&H4 / 0x4 - Display the YES and NO buttons
&H5 / 0x5 - Display the RETRY and Cancel buttons
&H10 / 0x10 - Display the "Critical Message" icon
&H20 / 0x20 - Display the "Warning Query" icon
&H30 / 0x30 - Display the "Warning Message" icon
&H40 / 0x40 - Display the "Information Message" icon
&H0 / 0x0 - 1st button is default
&H100 / 0x100 - 2nd button is default
&H200 / 0x200 - 3rd button is default
&H300 / 0x300 - 4th button is default
&H0 / 0x0 - Application modal mode. If the user wants to continue in the current application activities, then he must respond to the message box.
&H10000 / 0x10000 - System modal mode. All applications are suspended until the user responds to the message box.
&H10000000 / 0x10000000 - The window will be "Always on top" over normal windows.
Return value:
Returns a value corresponding to the pressed button.
1 - the "OK" button was clicked
2 - the "Cancel" button was clicked
3 - the "ABORT" button was clicked.
4 - the "RETRY" button was clicked.
5 - the "IGNORE" button was clicked.
6 - the "YES" button was clicked.
7 - the "NO" button was clicked.
This method is also functional in Web panels. The nStyle parameter is not functional for the Web and the method always returns only value 0.
See also:
Displays the window with a multiline text and with two buttons OK, Cancel
JavaScriptVBScriptSelect and copy to clipboard

var sText = "I must do at home:";
sText += "\\n 1) Wash the dishes";
sText += "\\n 2) Clean up";
if (1 == Pm.MessageBox("Title", sText, 0x10000000))
// If the "OK" button has been pressed...
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- MessageBox
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.