[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomButton.Default

True if the button is the default button in a modal form.

## Declaration

Source position: stdctrls.pp line 1255

`public property TCustomButton.Default : Boolean read FDefault write SetDefault default False;`

## Description

Default is a Boolean property which indicates if the button can be used as the default button control on a form. Default is essentially a design-time setting that indicates an intent. At run-time, the default button is the ActiveDefaultControl on the form. The default value for the property is False.

Setting a new value for the property causes the button control to be assigned to the DefaultControl property in the parent form. The widgetset class is notified when the property value is set.

The value in Default is used in the CreateParams method to determine style flags included in the creation parameters for the control. It is used in ExecuteDefaultAction to determine if the Click method can be called for the control.

The value in Default is automatically updated in the UpdateRolesForForm method.

Pressing Enter in a modal form is equivalent to clicking on the Default button.