See Also
Applies To
Command button.
Description
Determines which command button is the default button on a form.
Usage
[form.]commandbutton.Default[ = { True|False}]
Setting
The Default property settings are:
Setting Description
True The command button is the default button. Only one button on a form can be the default button. When Default is set to True for one button, it is automatically set to False for all other buttons on the form. When the button's Default property is True and its parent form is active, the user can choose the button (invoking its Click event) by pressing the Enter key. Any other control with the focus does not receive a keyboard event (KeyDown , KeyPress , or KeyUp ) for the Enter key unless the user has moved the focus to another command button on the same form. In this case, pressing Enter chooses that button instead of the default button.
False (Default) The command button is not the default button.
Remarks
For a form or dialog box that supports an irreversible action such as a delete operation, make the Cancel button the default button by setting its Default property to True.
Data Type
Integer (Boolean)
Help:
Cancel Property
Programmer's Guide:
Chapter 3, "Creating and Using Controls"