backgrounworker

  • Thread starter Thread starter Vergassivellaunus
  • Start date Start date
V

Vergassivellaunus

Guest
I inserted a backgroundworker form in my project.

My intention is to execute a long time evaluation without blocking the graphic interface.

These 2 routines should do the job:

Public Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted

End Sub

Public Sub BackgroundWorker1_DoWork(sender As Object, e As ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
x=math_evaluation() 'x is an array
End Sub

When math_evaluation is completed, RunWorkerCompleted should be triggered, but this does not happens.

If I use in dowork not a function but a sub, it works:

Public Sub BackgroundWorker1_DoWork(sender As Object, e As ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
math_evaluation()
End Sub

This is ok.

What is wrong?

Continue reading...
 

Similar threads

V
Replies
0
Views
283
Vergassivellaunus
V
V
Replies
0
Views
319
Vergassivellaunus
V
Back
Top