DEFAULT-BUTTON

If you assign the handle value of a push button control to the dialog's DEFAULT-BUTTON attribute, the push button control's click event handler is triggered when the end user presses ENTER in the dialog.

This is true unless another push button control has the focus, in which case pressing of ENTER triggers the focused button's click event handler.

A push button control defined as DEFAULT-BUTTON overrides a push button control defined as OK button (STYLE = 'O').

Alternatively to a push button also an ActiveX control can be assigned to the DEFAULT_BUTTON attribute, provided it behaves like a button. These ActiveX controls are marked in the system registry with the style OLEMISC_ACTSLIKEBUTTON.

Note:
Default buttons have a black margin.

Applies to Dialog (all types).
Data Type HANDLE
Default Value NULL-HANDLE
Possible Values NULL-HANDLE or any push button control handle