[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Is this control allowed to receive the focus when parent form is visible?
Source position: controls.pp line 2407
public function TWinControl.CanFocus: Boolean; virtual; |
Checks if the control can get focus when parent form is visible, i.e. if all its parents except the form are visible and enabled.
A possible usage:
if FormFoo.EditBar.CanFocus then FormFoo.ActiveControl := FormFoo.EditBar;
Remark: | CanFocus returns True even if the parent form is not actually visible, and a subsequent SetFocus call could throw an exception. Use CanSetFocus in this case. |
|
Is this control allowed to receive the focus? |
|
|
Ensures that the control or window handle has focus. |
|
|
Is this control allowed to receive the focus when parent form is visible? |
Version 3.2 | Generated 2024-02-25 | Home |