[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 2236
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.EditFoo.CanFocus then FormFoo.ActiveControl := FormFoo.EditFoo;
Please note that this function returns True also if the parent form isn't visible and therefore a consecutive SetFocus call could throw an exception. Use CanSetFocus in this case.
|
Is this control allowed to receive the focus? |
lazarus-ccr.sourceforge.net |