Determines if a pushbutton is the form’s default pushbutton.

Property of

PushButton

Description

Use the default property to make a pushbutton the default pushbutton when the user submits a form by pressing Enter. This behavior is used primarily for dialog boxes, when either the OK or Cancel button being the default, whichever is more appropriate. Setting the default property of a pushbutton to true gives the pushbutton a visual highlight that identifies it as the default.

Setting the default property to true causes two things to happen when the user presses Enter when the focus is not on a pushbutton:

The onClick subroutine of the default pushbutton executes.

The id property of the default pushbutton is passed to the form’s onSelection event handler.

However, if the user clicks on any pushbutton, the onClick event handler of that pushbutton executes. The id value of that pushbutton is passed to the onSelection event, even if the default property of another pushbutton is true.

If you give more than one pushbutton a default value of true, the last pushbutton to get the value is the default.

The default property will only work when SET CUAENTER is set to ON. When CUAENTER is OFF, the Enter key emulates the Tab key and merely shifts focus to the next control.