[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Gets or sets the active control on the form.
Source position: forms.pp line 762
public property TCustomForm.ActiveControl : TWinControl |
ActiveControl is a TWinControl property which contains the control which has focus on the form. The property can contain Nil if the parent form is hidden, disabled, or has never been activated.
Setting a new value for the property performs validity checks to ensure that the specified control can receive focus when the form is Visible. An EInvalidOperation exception is raised with the message in SCannotFocus when the new property value contains:
The value in the LastActiveControl property is updated with the existing value for ActiveControl if it is a control and not a TForm/TCustomForm instance. If the form (and not a control) was active, LastActiveControl is set to Nil.
At run-time, the new active control is focused and activated if its form is active (Active = True). ActiveChanged is called too. Both of these steps are omitted at design-time or when the component is loaded during component streaming.
The value in ActiveControl is updated in the FocusControl and DefocusControl methods.
|
Tracks focus changes for the active form or the last active control on the current form. |
|
|
Indicates if the form is enabled, visible, and has focus. |
|
|
An empty implementation in TCustomForm. |
|
|
Gives focus to the specified control. |
|
|
Updates ActiveControl if it is to be de-focused. |
|
|
Gets the form instance for the specified Control. |
|
|
Is this control allowed to receive the focus when parent form is visible? |
Version 4.0 | Generated 2025-05-03 | Home |