J
Jerry Spence1
I am trying to create timers on demand by doing the following:
Dim NewTimer As New System.Timers.Timer
NewTimer.Interval = 10000
AddHandler NewTimer.Elapsed, AddressOf Timeup
NewTimer.Enabled = True
NewTimer.Start()
My problem then happens in the TimeUp routine
Normally, to get the name of the control that has been fired you would do:
Private Sub Timeup(ByVal sender As System.Object, ByVal e As
System.Timers.ElapsedEventArgs)
Dim mytimer = DirectCast(sender, Control).Name.ToString
End Sub
The problem is that timers do not have a property called 'Name'. How can I
reference which timer is being fired?
Thanks
-Jerry
Dim NewTimer As New System.Timers.Timer
NewTimer.Interval = 10000
AddHandler NewTimer.Elapsed, AddressOf Timeup
NewTimer.Enabled = True
NewTimer.Start()
My problem then happens in the TimeUp routine
Normally, to get the name of the control that has been fired you would do:
Private Sub Timeup(ByVal sender As System.Object, ByVal e As
System.Timers.ElapsedEventArgs)
Dim mytimer = DirectCast(sender, Control).Name.ToString
End Sub
The problem is that timers do not have a property called 'Name'. How can I
reference which timer is being fired?
Thanks
-Jerry