Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2010 What's the best way to run mudule routines in a backgroundworker from a parent form?

$
0
0
My app has a main form where the user sets several values and has a progress indicator and cancel button. In the form I have a dozen of triplet subs for BackgroundWorkers. EG “Private Sub Frank_DoWork, Private Sub Frank_ProgressChanged, Private Sub Frank_RunWorkerCompleted”. In each DoWork there are hundreds of lines so I would like to make it more manageable. The first thought that I had was that the BackgroundWorkers all act exactly the same so I’m thinking I should have only one executed in the main form then within that BackgroundWorker I could conditionally call different modules which would encapsulate the variable routines. The only head scratcher is how to handle the progress indicator and cancel from within the module's subroutine. Am I heading in the right direction or is this a dead end? If not the best approach could someone suggest an alternative?

Viewing all articles
Browse latest Browse all 27189

Trending Articles