title: How to dynamically create a background worker in VB.net
body: <p>I have a VB.net project which uses a background worker to do some stuff.</p>
  
  <p>Now I want to expand the project to be able to do multiple stuff :)</p>
  
  <p>A user can enter an URL in a textbox and when the user click on the parse button the program creates a new tabcontrol a outputs some data.</p>
  
  <p>I use a hardcoded background worker for this.</p>
  
  <p>But now I want to run multiple background workers to do this stuff so I can't rely on hard coding the background worker(s).</p>
  
  <p>Is it possible to create background workers dynamically.</p>
  
  <p>I just don't have any idea how to set this up since I think I need to set up the different methods and variables like:</p>
  
  <pre><code>Private bw As BackgroundWorker = New BackgroundWorker
  bw.WorkerReportsProgress = True
  bw.WorkerSupportsCancellation = True
  AddHandler bw.DoWork, AddressOf bw_DoWork
  AddHandler bw.ProgressChanged, AddressOf bw_ProgressChanged
  AddHandler bw.RunWorkerCompleted, AddressOf bw_RunWorkerCompleted
  bw.RunWorkerAsync()
  </code></pre>
  
  <p><code>Private Sub bw_DoWork()</code>, <code>Private Sub bw_RunWorkerCompleted()</code> and <code>Private Sub bw_ProgressChanged()</code></p>
  
  <p>I think I need to declare the background workers in some sort of array like variable (<code>list</code> / <code>dictionary</code>)??? Other then that I have no idea how to tackle this.</p>