Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Add timers to an array of objects
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Bobby, post: 11233863"] Dear all, could someone show me how one would complete the following MSDN example : '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Class Timer1 Public Shared Sub Main() Dim aTimer As New System.Timers.Timer() AddHandler aTimer.Elapsed, AddressOf OnTimedEvent ' Set the Interval to 5 seconds. aTimer.Interval = 5000 aTimer.Enabled = True Console.WriteLine("Press 'q' to quit the sample.") While Console.Read() <> CInt("q") End While End Sub ' Specify what you want to happen when the Elapsed event is raised. Private Shared Sub OnTimedEvent(source As Object, e As ElapsedEventArgs) Console.WriteLine("Hello World!") End Sub End Class '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' so that one could have Timers for different objects and in the OnTimeEvent you could get the object to whom this timer belongs? Is this possible at all? Many Thanks. [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Add timers to an array of objects
Top