Sign in Join
FPDoc Onlineexperiment

TCustomTimer.OnTimer property

Member of TCustomTimerpublicIn unit CustomTimer

Event handler signalled when the Interval for the timer has elapsed.

Declaration

pascal
property OnTimer: TNotifyEvent read FOnTimer write SetOnTimer;

Description

OnTimer is a TNotifyEvent property that implements the event handler signalled when the Interval for the timer has elapsed. The default value for the property is Nil as assigned in the constructor for the class instance.

Assign a TNotifyEvent procedure to the event handler to perform actions needed for the event notification. Setting the value in OnTimer causes the UpdateTimer method to be called to reflect the current values for the timer class instance.

Please note that OnTimer is not signalled during timer execution when Interval contains the value 0 (zero).

Use the OnStartTimer event handler to perform actions required when the timer is started by setting Enabled to True.

Use the OnStopTimer event handler to perform actions needed when the timer is halted by setting Enabled to False, or when calling the destructor for an executing timer class instance.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.