[02/03] strange Thread Issue
I have an application in VB.NET 2003 whose flow is something like this. As the application starts, a Timer runs after 5 seconds, which first of all disables itself, then calls a function FillGrid. This function in turn calls a Thread. The function in this Thread does the work and in the end re enables the timer to go through the whole cycle again.
Everything seems to be OK but the problem is that the timer does not get re enabled which means that the application goes only one cycle where as it is meant to run inifinitely. here is the code.
VB Code:
Private Sub timerUCI_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timerUCI.Tick
'Disable this Timer
timerUCI.Enabled = False
'Fill Grid
FillGrid()
End Sub
Private Sub FillGrid()
'Some Code
'Initialize Thread
thrConverter = New Threading.Thread(AddressOf StartConversion)
'Start Thread for Conversion
thrConverter.Start()
End Sub
Private Sub StartConversion()
'Conversion Process
'Re Enable Timer
timerUCI.Enabled = True
End Sub
Re: [02/03] strange Thread Issue
Have you tried putting the timerUCI.Enabled = True line inside a Try-Catch statement?
Re: [02/03] strange Thread Issue
I dint earlier, but did it after your reply, but to no avail as i knew there were no exceptions, the application is running fine.