Guest Vergassivellaunus Posted January 18, 2021 Posted January 18, 2021 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... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.