Sign in Join
FPDoc Onlineexperiment

TCustomForm.OnActivate property

Member of TCustomFormpublicIn unit Forms

Handler signalled when the form instance receives focus.

Declaration

pascal
property 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.

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.