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

# TCustomButton.UpdateDefaultCancel

Updates the Default and Cancel properties in the parent form.

## Declaration

Source position: stdctrls.pp line 1244

`protected procedure TCustomButton.UpdateDefaultCancel;`

## Description

UpdateDefaultCancel is a method used to update the default and cancel controls on the parent form.

UpdateDefaultCancel calls GetParentForm to get the parent for the control. When the parent form has been assigned, its DefaultControl and CancelControl properties are updated when needed. DefaultControl is updated when the Default property is set to True. CancelControl is updated when the Cancel property is set to True.

UpdateDefaultCancel calls WSSetDefault to notify the widgetset class when the control is the default control.

UpdateDefaultCancel is called from the CreateWnd and Loaded methods.

## See also

TCustomButton.Cancel |  | True if the button is the modal Cancel button.
TCustomButton.Default |  | True if the button is the default button in a modal form.
TCustomButton.Active |  | True if the control is the Cancel or Default button.
TCustomButton.WSSetDefault |  | Notifies the widgetset class of a change to the Default property.
GetParentForm |  | Gets the form instance for the specified Control.
TCustomForm.CancelControl |  | The control associated with the Cancel action.
TCustomForm.DefaultControl |  | The control associated with the default action for this form.