[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Is this control allowed to receive the focus?
Source position: controls.pp line 2408
public function TWinControl.CanSetFocus: Boolean; virtual; |
Checks if the control can receive focus, i.e. if all its parents are visible and enabled.
A possible usage:
if MyControl.CanSetFocus then MyControl.SetFocus;
CanSetFocus should be preferred over CanFocus if used in CanSetFocus/SetFocus combination because it checks also if the parent form can receive focus and thus prevents the "cannot focus an invisible window" LCL exception.
|
Is this control allowed to receive the focus when parent form is visible? |
|
|
Ensures that the control or window handle has focus. |
Version 3.2 | Generated 2024-02-25 | Home |