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




Reply With Quote