ModalResult Property

Applies to TestComplete 14.50, last modified on April 22, 2021

Specifies the value which is returned by the UserForm.ShowModal method when the given button is clicked.

Declaration

buttonObj.ModalResult
Read-Write Property Integer
buttonObj     A TcxButton object  

Applies To

The property applies to the following components:

TcxButton

Description

Use the ModalResult property to get or set the value that is returned by the UserForm.ShowModal method when the form is closed by clicking the given button.

If a button’s ModalResult property is set to anything other than mrNone and the form is displayed as the modal dialog (using the ShowModal method), then clicking this button closes the form, assigns the form’s ModalResult property with the same value as the button’s ModalResult property and returns this value as the result of the ShowModal method. You do not need to create an event handler for the button’s OnClick event which would close the modal form.

Property Value

One of the following constants defined in the BuiltIn object:

Constant Value Description
mrNone 0 None. The button does not close the form. This is the default value.
mrOk 1 The dialog return value is OK.
mrCancel 2 The dialog return value is Cancel.
mrAbort 3 The dialog return value is Abort.
mrRetry 4 The dialog return value is Retry.
mrIgnore 5 The dialog return value is Ignore.
mrYes 6 The dialog return value is Yes.
mrNo 7 The dialog return value is No.
mrAll 8 The dialog return value is All.
mrNoToAll 9 The dialog return value is No To All.
mrYesToAll 10 The dialog return value is Yes To All.

See Also

Cancel Property
Default Property (TcxButton)
ModalResult Property
ShowModal Method

Highlight search results