DispatcherTimer.Tick Event

Occurs when the timer interval has elapsed.

Namespace:  System.Windows.Threading
Assembly:  System.Windows (in System.Windows.dll)

public event EventHandler Tick

The following code example demonstrates how to use this event.

private void TestDispatcherTimer(Panel counterPanel)
    DispatcherTimer timer = new DispatcherTimer();
    int counter = 0;

    counterPanel.MouseLeftButtonDown += 
        delegate(object s, MouseButtonEventArgs args) {
            if (timer.IsEnabled) timer.Stop(); else timer.Start(); 

    timer.Tick += 
        delegate(object s, EventArgs args) {
            counterPanel.Children.Add( new TextBlock { 
                Text = counter++.ToString() });

    timer.Interval = new TimeSpan(0, 0, 1); // one second


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions