Gene,
I am made this little sample some days ago which I changed a little bit now
for you in this message. (Instead of the dynamicly build timers and the
addhandler you can as well use the normal dragged timer and the events using
the combobox, and than that directcast is not needed in the events but you
can take the timer itself)
I hope this helps?
Cor
\\\It needs on a form 3 buttons
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim timer1 As New System.Windows.Forms.Timer
TextBox1.Text = "0"
TextBox2.Text = "0"
TextBox3.Text = "0"
AddHandler timer1.Tick, AddressOf mytimer1
timer1.Enabled = True
timer1.Interval = 4000
Dim timer2 As New System.Windows.Forms.Timer
AddHandler timer2.Tick, AddressOf mytimer2
timer2.Enabled = True
timer2.Interval = 300
Dim timer3 As New System.Windows.Forms.Timer
AddHandler timer3.Tick, AddressOf mytimer3
timer3.Enabled = True
timer3.Interval = 20
End Sub
Public Sub mytimer1(ByVal sender As Object, _
ByVal e As System.EventArgs)
TextBox1.Text = (CInt(TextBox1.Text) + 1).ToString
DirectCast(sender, System.Windows.Forms.Timer).Enabled = True
End Sub
Public Sub mytimer2(ByVal sender As Object, _
ByVal e As System.EventArgs)
TextBox2.Text = (CInt(TextBox2.Text) + 1).ToString
DirectCast(sender, System.Windows.Forms.Timer).Enabled = True
End Sub
Public Sub mytimer3(ByVal sender As Object, _
ByVal e As System.EventArgs)
TextBox3.Text = (CInt(TextBox3.Text) + 1).ToString
DirectCast(sender, System.Windows.Forms.Timer).Enabled = True
End Sub
End Sub
///
"Gene Hubert" <gw******@hotmail.com>
I seem to be getting crazy results when I have multiple
System.Windows.Forms.Timer objects in the same form running at the
same time. When only one timer is running I get the expected
behavior. When I have two timers running at once, one fires reliably
and the other fires almost never. Are there any known issues with
this?
Thanks,
Gene H.