# _CustomControlTimerEvents interface
{: .no_toc }

The event source interface of [**CustomControlTimer**](/tB/Packages/CustomControls/Framework/CustomControlTimer.md), declaring the single [**OnTimer**](#ontimer) callback that fires on each tick.

This interface is the **\[Default, Source\]** interface of the **CustomControlTimer** CoClass. A field declared with `WithEvents` receives the **OnTimer** event through this interface automatically; there is no need to reference `_CustomControlTimerEvents` by name in application code.

```tb check_build concat_group=timerevents-overview
Private WithEvents InternalTimer As CustomControlTimer

Private Sub OnInitialize(ByVal Ctx As CustomControls.CustomControlContext) _
        Implements CustomControls.ICustomControl.Initialize

    Set Me.InternalTimer = CType(Of CustomControlTimer)(Ctx.CreateTimer())
    Me.InternalTimer.Interval = 100
    Me.InternalTimer.Enabled = True
End Sub

Private Sub OnTimer() Handles InternalTimer.OnTimer
    ' called every 100 ms while the timer is enabled
End Sub
```

## Events

### OnTimer
{: .no_toc }

Raised every [**Interval**](/tB/Packages/CustomControls/Framework/CustomControlTimer.md#interval) milliseconds while the timer's [**Enabled**](/tB/Packages/CustomControls/Framework/CustomControlTimer.md#enabled) property is **True**.

Syntax: *object*\_**OnTimer**( )

## See Also

- [CustomControlTimer](/tB/Packages/CustomControls/Framework/CustomControlTimer.md) -- the timer class whose ticks fire **OnTimer**; exposes **Interval** and **Enabled**
- [CustomControlContext](/tB/Packages/CustomControls/Framework/CustomControlContext.md) -- supplies **CreateTimer**, the factory method that returns a **CustomControlTimer**
