Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TWinControl.SetFocus

Ensures that the control or window handle has focus.

Declaration

Source position: controls.pp line 2361

public procedure TWinControl.SetFocus; virtual;

Description

SetFocus is a procedure used to give focus to the current control. SetFocus calls GetParentForm for the control instance, and uses its FocusControl method to change the focused control.

If the parent Form is unassigned (contains Nil), the LCL interface is used to change focus to the handle for the control. No actions are performed in the method when Form is unassigned and the control does not have an allocated handle.



CT Web help

CodeTyphon Studio