create timer in class
-
In VB2005, how can I dinamically create a Timer inside a class without using the control. I suppose that I have to use the System.Timers.Timer class but I don't know how to handle the Elapsed event. Thanks in advance, Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
-
In VB2005, how can I dinamically create a Timer inside a class without using the control. I suppose that I have to use the System.Timers.Timer class but I don't know how to handle the Elapsed event. Thanks in advance, Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
Do you mean something like this?
Private Sub TimerForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Timer1 As New System.Timers.Timer()
AddHandler Timer1.Elapsed, AddressOf TimerEvent
End SubPrivate Shared Sub TimerEvent(source As Object, e As Timers.ElapsedEventArgs)
MsgBox("Hello World!")
End Sub
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
In VB2005, how can I dinamically create a Timer inside a class without using the control. I suppose that I have to use the System.Timers.Timer class but I don't know how to handle the Elapsed event. Thanks in advance, Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
-
Yep thanks, I missed the WithEvents modifier.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits