aqDlg.MessageDlg Method

Applies to TestComplete 15.68, last modified on October 16, 2024

Description

The aqDlg.MessageDlg method displays a message box. This message box can contain some information, a warning, etc. You can specify which buttons will be displayed in the dialog.

Declaration

aqDlg.MessageDlg(Message, DlgType, Btns)

Message [in]    Required    String    
DlgType [in]    Required    Integer    
Btns [in]    Required    Integer    
Result Integer

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

Message

Defines the text to be displayed in the message box.

DlgType

Determines the type of the message box. The chosen type affects the dialog appearance (namely, the dialog’s icon) and emphasizes the purpose of displaying the dialog. The following dialog types are available.

Constant Value Description Dialog Icon
mtInformation 0 The dialogs of this type are mainly used to display general information. An icon consisting of an "i" in a circle.
mtError 1 The dialogs of this type are mainly used to report of critical errors. A red stop-sign icon.
mtWarning 2 The dialogs of this type are mainly used to display warnings. An exclamation-point icon.
mtConfirmation 3 The dialogs of this type are mainly used to ask a user for confirmation. A question-mark icon.

Btns

Specifies the buttons to be displayed in the message box. This parameter can be any of the following values, or any combination of them:

Constant Value Button
mbYes 1 "Yes" button
mbNo 2 "No" button
mbOk 4 "OK" button
mbCancel 8 "Cancel" button
mbAbort 16 "Abort" button
mbRetry 32 "Retry" button
mbIgnore 64 "Ignore" button
mbAll 128 "All" button
mbNoToAll 256 "No to All" button
mbYesToAll 512 "Yes to All" button

To form a combination of values, just sum up the needed values.

Result Value

The MessageDlg method returns one of the constants that indicates which button the user has pressed in the message box:

Constant Value Description
mrOk 1 The "OK" button was selected.
mrCancel 2 The "Cancel" button was selected.
mrAbort 3 The "Abort" button was selected.
mrRetry 4 The "Retry" button was selected.
mrIgnore 5 The "Ignore" button was selected.
mrYes 6 The "Yes" button was selected.
mrNo 7 The "No" button was selected.
mrAll 8 The "All" button was selected.
mrNoToAll 9 The "No To All" button was selected.
mrYesToAll 10 The "Yes To All" button was selected.

Remarks

The aqDlg object and all of its methods can only be used in script extensions. If you need to show the custom message box from an ordinary script, use the TestComplete built-in MessageDlg function.

See Also

aqDlg Object
ShowMessage Method
ShowError Method
MkSet Function

Highlight search results