Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 1.1
.NET Framework
Reference
System.Timers
Timer Class
Methods
 Stop Method

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
Timer.Stop Method

Stops raising the Elapsed event by setting Enabled to false.

[Visual Basic]
Public Sub Stop()
[C#]
public void Stop();
[C++]
public: void Stop();
[JScript]
public function Stop();

Remarks

You can also stop timing by setting Enabled to false.

Note   The event-handling method might be called even after the Stop method is called. The Timer component is multithreaded to ensure more accuracy. However, this means that the call to the event-handling method might run on one thread at the same time that a call to the Stop method runs on another thread. This might result in the Elapsed event being raised even after the Stop method is called. To prevent this, use the SignalTime property to compare the time the event was raised to the time the Stop method was called. If the event was raised after the Stop method was called, do not process the event.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Timer Class | Timer Members | System.Timers Namespace | Enabled | Start | Elapsed

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker