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:
  1. Private Sub timerUCI_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timerUCI.Tick
  2.             'Disable this Timer
  3.             timerUCI.Enabled = False
  4.             'Fill Grid
  5.             FillGrid()
  6.     End Sub
  7.  
  8. Private Sub FillGrid()
  9.                     'Some Code
  10.  
  11.                     'Initialize Thread
  12.                     thrConverter = New Threading.Thread(AddressOf StartConversion)
  13.  
  14.  
  15.                     'Start Thread for Conversion
  16.                     thrConverter.Start()
  17.  
  18.     End Sub
  19.  
  20. Private Sub StartConversion()
  21.         'Conversion Process
  22.  
  23.         'Re Enable Timer
  24.         timerUCI.Enabled = True
  25.     End Sub