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

# TCustomForm.GetRolesForControl

Gets the role(s) for the control in a modal form (default or cancel button).

## Declaration

Source position: forms.pp line 716

`public function TCustomForm.GetRolesForControl(`
`AControl: TControl`
`):TControlRolesForForm;`

## Arguments

`AControl` |  | TControl instance examined and compared to the values for the form instance.

## Function result

Set of TControlRoleForForm values for the specified control. The default return value is an empty set ([]).

## See also

TCustomForm.DefaultControl |  | The control associated with the default action for this form.
TCustomForm.CancelControl |  | The control associated with the Cancel action.
TControlRolesForForm |  | Set type used to store values from the TControlRoleForForm enumeration.
TControlRoleForForm |  | Possible default actions on special keys.