Returns or sets whether the control is to receive the ESC key when it is pressed while the parent form has the focus.
Object.Cancel [ = bCancel ]
The Cancel property syntax has the following parts:
Name |
Type |
Description |
Object |
AButton |
AButton control |
bCancel |
Bool |
A boolean expression that specifies whether the control is to receive the ESC key when it is pressed while the parent form has the focus. |
bCancel can be one of the following:
Value |
Description |
True |
The button receives the ESC key while the parent has the focus, or when the user clicks on the button, the OnClick event of the control is called. |
False * |
The button does not receive the ESC key while the parent has the focus. When the user clicks on the button, the OnClick event of the control is still called. |
This property is assigned by ATEasy to controls that act like buttons.
When the button's Cancel property is set to True and the form is in the active window, pressing the ESC key will cause the control to receive the OnClick event.
Only one control on a form can have the Cancel property set to True. When the Cancel property is set to True for one button, it is automatically set to False for all other buttons on the form.
The following statement changes the AButton to become the Cancel push button of the form:
btn1.Cancel=True