Question Application unresponsive after moving window (when running)

Slider

Member
Joined
Jun 11, 2009
Messages
22
Programming Experience
Beginner
Hi

I have an application (written in VB.net 2008) which reads a text file. Parses the record and uses the second field (a UK postcode) to match an Access database (SQL - Select * from Table1 ......), then writes a text file back out with the original input postcode plus several fields taken from the access database.

I have 3 counts happening during the process, records read, postcodes matched and postcodes not matched. I move these values to labels on the form, then every 50 records read, I refresh the form (me.refresh) to update the labels (showing the end user where the process is upto).

When running, if I drag the window around the screen, or minimize then maximize, or click off the window to another window, the application seems to freeze and the counter labels do not refresh.

Please could someone offer some advice on why this happening. The application appears to be still running as the text output file is still being built.

Thank you.
 
Last edited:
You shouldn't be doning time consuming tasks in UI thread at all. VB.Net enable you to write multithreaded applications. I recommend you start by adding a BackgroundWorker component from Toolbox to the form and use that for background work. BackgroundWorker Class (System.ComponentModel) The sample code show how to pass progress/result, ProgressChanged/RunWorkerCompleted events is the only places you should interact with UI during the processing.
 
Back
Top