Hi Guys,

I am using VB.NET (2008). I have tried using threading before and I did encounter issues. Then I wrote in this forum and jmcilhinney helped me. It did solve my problem and I am grateful for that. The thread can be found here
Thread here

My current problem is as follows :-

- I have a form with various controls incl a timer control.
- Task: when i click on start , timer starts and at regular intervals it downloads a file and processes it.
- Then it becomes idle for a while before repeating it.
- No threading used in this form so far.

Now when the timer is idle then I need to do some processing. So I thought that I can create a thread and use that thread to do the processing so that the application remains responsive.

I wrote the following code :

Code:
' General
Dim DataThread as Thread

Private Sub TimerMain_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TimerMain.Tick

If timerjobdone = True then
Call ExecuteThreadCode()
TimerMain.Interval = 10000
end if

End Sub

Private Sub ExecuteThreadCode()

DataThread = new thread(addressof DoProcessing)
Datathread.start


End Sub

Private sub DoProcessing()

' Here I need to access the label of the form so i need to do invoke method
' I do some file reading and other processing here

End sub
Now when the code segment executes my application becomes unresponsive. I mean i used threading to make program more accessible to user or responsive but it does not work.

Will be glad if anyone can help me out.

Thanks a lot,

GR