|[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index]||[#lcl]|
Ensures that the control or window handle has focus.
Source position: controls.pp line 2404
public procedure TWinControl.SetFocus; virtual;
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|