DispatcherTimer.Start Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts the DispatcherTimer.
public:
void Start();
public void Start ();
member this.Start : unit -> unit
Public Sub Start ()
Examples
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 = TimeSpan.FromSeconds(1);
dispatcherTimer.Start();
' DispatcherTimer setup
dispatcherTimer = New Threading.DispatcherTimer()
AddHandler dispatcherTimer.Tick, AddressOf dispatcherTimer_Tick
dispatcherTimer.Interval = New TimeSpan(0,0,1)
dispatcherTimer.Start()
Remarks
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 resets the timer Interval.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om