Chipmunk Baby
June 16th, 2008, 09:37 PM
I have a progream that draws on form using a data file
I call the bacground worker thread in in Form_Paint
this.bgworkerthread.RunAsync...() //i forgot the predefined funtion name
while(isbusy)
{application.doevents()}
and in the doWork of bgworkerthread I try drawing
Also , I have zooming function for the graph when the datanumber is large
which again calls Refresh() for form,
This way, I don't know if it is correct but the workerthread work fine (I can close the form white reading or drawing large file).
Only the the zoom fails because "the the workerthread can not be used with multiple tasks at the same time"
I debug and see it's the Refresh that causes the exception.
Is my way of implemeting the workerthread incorrect ?
Thanks
I call the bacground worker thread in in Form_Paint
this.bgworkerthread.RunAsync...() //i forgot the predefined funtion name
while(isbusy)
{application.doevents()}
and in the doWork of bgworkerthread I try drawing
Also , I have zooming function for the graph when the datanumber is large
which again calls Refresh() for form,
This way, I don't know if it is correct but the workerthread work fine (I can close the form white reading or drawing large file).
Only the the zoom fails because "the the workerthread can not be used with multiple tasks at the same time"
I debug and see it's the Refresh that causes the exception.
Is my way of implemeting the workerthread incorrect ?
Thanks