Interval
Time between Timer events in milliseconds. 0 disables the timer: no Timer event while Interval is 0, whatever Enabled is. Events run on the UI thread.
Range: 0 to 2147483647.
Separate a checkbox activation from its stored Boolean value.
Click describes activation, while Change describes a value transition. The clock’s running state must follow the checkbox value rather than toggling an unrelated flag each time. Keep timer handlers short and update the display from the current clock value.
Add Timer to the component tray and name it Timer1 for this example:
| Property | Example value |
|---|---|
Enabled | False |
Interval | 1000 |
A complete handler from Forms/frmMain.bas. The linked lesson includes its surrounding controls, declarations and helpers.
Private Sub Timer1_Timer()
lblLabel1.Caption = Format(Now, "HH:mm:ss")
End SubContract defaults are shown below. Where a new control has a different Designer starting value, that value is listed separately.
IntervalTime between Timer events in milliseconds. 0 disables the timer: no Timer event while Interval is 0, whatever Enabled is. Events run on the UI thread.
Range: 0 to 2147483647.
EnabledStarts or stops Timer events. The timer stops when its form unloads.
Replace control with the object’s Name when creating a handler. ByRef arguments may be changed by your handler; ByVal arguments report an input value.
Occurs on the UI dispatcher after each enabled timer interval.
Private Sub control_Timer()No parameters.
No methods are declared in this component’s built-in metadata. Use its documented properties and events; do not infer APIs from a similarly named control in another framework.
20f4bfed6b · Build manifest