Sign in Join
FPDoc Onlineexperiment

TCustomForm.FocusControl procedure

Member of TCustomFormpublicIn unit Forms

Gives focus to the specified control.

Declaration

pascal
procedure FocusControl(WinControl: TWinControl)

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).

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.