G
Guest
I'm having trouble implementing one of my standard timer
strategies. Because the code for a timer might take an
unspecified amount of time, in VB 6 I disabled the timer
until the timer event code completed.
Now in .NET I'm seeing the timer fire twice in succession,
even though the timer interval is long (1-4 seconds). A
simple project doesn't have this problem, but as more an
more complex it gets, it seems the timer goes haywire.
This is the code I'm using for the timer event is
tmrTurn.Enabled = False
RunMyCode()
Me.stbMain.Text = CurrentDate & " " & CurrentTime
Me.stbMain.Refresh()
tmrTurn.Enabled = True
There are no other references to tmrTurn and this is the
other timer. Doesn't matter the interval, it will always
fire twice before tmrTurn.Enabled=False is executed.
Using VS2003.
strategies. Because the code for a timer might take an
unspecified amount of time, in VB 6 I disabled the timer
until the timer event code completed.
Now in .NET I'm seeing the timer fire twice in succession,
even though the timer interval is long (1-4 seconds). A
simple project doesn't have this problem, but as more an
more complex it gets, it seems the timer goes haywire.
This is the code I'm using for the timer event is
tmrTurn.Enabled = False
RunMyCode()
Me.stbMain.Text = CurrentDate & " " & CurrentTime
Me.stbMain.Refresh()
tmrTurn.Enabled = True
There are no other references to tmrTurn and this is the
other timer. Doesn't matter the interval, it will always
fire twice before tmrTurn.Enabled=False is executed.
Using VS2003.