Export (0) Print
Expand All

DispatcherTimer.Start Method

Starts the DispatcherTimer.

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

public void Start()

Setting IsEnabled to false when the timer is started stops the timer.

Setting IsEnabled to true when the timer is stopped starts the timer.

Start sets IsEnabled to true.

Start resets the timer Interval.

The following example creates a DispatcherTimer. A new DispatcherTimer object named dispatcherTimer is created. The event handler dispatcherTimer_Tick is added to the Tick event. The Interval is set to 1 second using a TimeSpan object.

//  DispatcherTimer setup
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0,0,1);
dispatcherTimer.Start();

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft