I am using a webtimer to update a progress dialog while a thread (TOUCalc) runs. When the thread finishes, it kills the thread and runs one of two methods to display the results from the thread. My problem is that the “me.Mode = Timer.ModeOff” appears to be ignored and the timer fires repeatedly.
Sub Action() Handles Action
ProgressDialog.bar.Value = TOUCalc.iCount
if ProgressDialog.Bar.Maximum <= ProgressDialog.bar.Value Then
ProgressDialog.Close
TOUCalc.Kill
if TypeIndex = 12 Then
FinishTOU
Else
FinishTOUDetail
end if
me.Mode = Timer.ModeOff
end if
End Sub
I have set a breakpoint where the webtimer is activated and there is no reference to the timer in either FinishTOU or FinishTOUDetail. I have moved the “me.Mode =” line to different places within the “if…end if” with no change in result. I have changed the super from WebTimer to Timer and still no change. Suggestions for a different approach are most welcome.