Xbasic

UI_MSG_BOX Function

Syntax

Response_Code as N = UI_MSG_BOX(C title,C message[,N box_style])

Arguments

title

The title of the dialog box.

message

The message to display.

box_style

You form this message box variation by adding the values as youneed from as many of the following groups in the format: value1 + value2 + value3.

Value1
Button Combination
Description
UI_OK

OK button (default)

UI_OK_CANCEL

OK and Cancel buttons

UI_ABORT_RETRY_IGNORE

Abort, Retry, and Ignore buttons

UI_YES_NO_CANCEL

Yes, No, and Cancel buttons

UI_YES_NO

Yes and No buttons

UI_RETRY_CANCEL

Retry and Cancel buttons

Value2
Symbol Type
Description
UI_NO_SYMBOL

No symbol (default)

UI_STOP_SYMBOL

Stop symbol

UI_QUESTION_SYMBOL

Question symbol

UI_ATTENTION_SYMBOL

Attention symbol

UI_INFORMATION_SYMBOL

Information symbol

Value3
Default Button
Description
UI_FIRST_BUTTON_DEFAULT

First button is the default

UI_SECOND_BUTTON_DEFAULT

Second button is the default

UI_THIRD_BUTTON_DEFAULT

Third button is the default

Description

UI_MSG_BOX() displays several variations of the standard Windows message dialog box. The dialog box variation is determined by the value of the optional Message Type parameter. If you omit the Message_Type, a default message box with a single OK button appears.

images/UI_MSG_BOX.GIF
images/UI_MSG_BOX_2.GIF

The UI_MSG_BOX() function returns one of the following Response Codes:

Response Code
Description
UI_OK_SELECTED

OK selected

UI_CANCEL_SELECTED

Cancel selected

UI_ABORT_SELECTED

Abort selected

UI_RETRY_SELECTED

Retry selected

UI_IGNORE_SELECTED

Ignore selected

UI_YES_SELECTED

Yes selected

UI_NO_SELECTED

No selected

Example

Display a Yes, No, Cancel dialog box with a question mark icon and No selected as the default.

'Compute the code for the Message Type
code = UI_YES_NO_CANCEL + UI_QUESTION_SYMBOL + UI_SECOND_BUTTON_DEFAULT
response = ui_msg_box("Question", "Save before leaving? ", code)
if response = UI_YES_SELECTED then
    'Yes selected
    '------------
elseif response = UI_NO_SELECTED then
    'No selected
    '-----------
elseif response = UI_CANCEL_SELECTED then
    'Cancel selected
    '---------------
end if

Limitations

Desktop applications only.

See Also