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

# TCustomForm.FocusControl

Gives focus to the specified control.

## Declaration

Source position: forms.pp line 712

`public procedure TCustomForm.FocusControl(`
`WinControl: TWinControl`
`);`

## Arguments

`WinControl` |  | The control receiving the focus.

## Description

FocusControl is a procedure used to give focus to the control specified in WinControl. FocusControl ensures that the ActiveControl property is updated when needed, and may raise an exception if WinControl cannot be focused. If the form instance was not already Active, the SetFocus method is called.

## Errors

If the control or one of its parents is not visible or disabled, an exception will be raised (in SetFocus).