Visual Basic Reference

Interval Property

See Also    Example    Applies To

Returns or sets the number of milliseconds between calls to a Timer control's Timer event.

Syntax

object.Interval [= milliseconds]

The Interval property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
milliseconds A numeric expression specifying the number of milliseconds, as described in Settings.

Settings

The settings for milliseconds are:

Setting Description
0 (Default) Disables a Timer control.
1 to 65,535 Sets an interval (in milliseconds) that takes effect when a Timer control's Enabled property is set to True. For example, a value of 10,000 milliseconds equals 10 seconds. The maximum, 65,535 milliseconds, is equivalent to just over 1 minute.

Remarks

You can set a Timer control's Interval property at design time or run time. When using the Interval property, remember:

  • The Timer control's Enabled property determines whether the control responds to the passage of time. Set Enabled to False to turn a Timer control off, and to True to turn it on. When a Timer control is enabled, its countdown always starts from the value of its Interval property setting.

  • Create a Timer event procedure to tell Visual Basic what to do each time the Interval has passed.