[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TCustomForm.OnActivate

Handler signalled when the form instance receives focus.

## Declaration

Source position: forms.pp line 799

`public property TCustomForm.OnActivate : TNotifyEvent read FOnActivate write FOnActivate;`

## Description

OnActivate is a TNotifyEvent property with the event handler signalled when the form instance receives focus. OnActivate is signalled when assigned from the Activate method, and occurs the first time the form is focused at application start up, and each time focus is changed from another form in the same application to this form instance.

Remark: | OnActivate is not signalled the very first time a maximized or fullscreen form is activated. This is done to suppress the notification until resize and bounds changes are handled in delayed events that occur during LCL component streaming.

Use OnDeactivate to perform actions needed when a form instance loses focus.

Use OnShow or OnHide to perform actions needed when the Visible property for a form instance is changed.

Use OnWindowStateChange to perform actions needed when a form is minimized, maximized, or changed from the fullscreen to the normal state.

Use the Application.OnActivate event handler to perform actions needed when the Application is given focus over another process or program.

## See also

TCustomForm.Activate |  | Signals the OnActivate event handler when a form is focused in an application.
TCustomForm.Deactivate |  | Performs actions when the form loses focus.
TCustomForm.OnDeactivate |  | Handler signalled when the form is deactivated (loses focus).
TCustomForm.WindowState |  | Indicates whether the form is displayed in a minimized, maximized, full-screen or normal state.
TCustomForm.OnShow |  | Handler called when the form becomes visible.
TCustomForm.OnHide |  | Handler called when the form is being hidden.
TCustomForm.OnWindowStateChange |  | Handler called when the form is minimized, maximized or restored.
TCustomForm.Visible |  | Indicates if the control is visible on its parent.
TApplication.OnActivate |  | Event handler signalled when an Activate message is handled in the application.
TApplication.QueueAsyncCall |  | Inserts an asynchronous call into the queue.
TControl.OnChangeBounds |  | Event handler signalled when the Bounds for the control have been changed.
TControl.OnResize |  | Notification handler for a resize of the control.