title: VB NET problems with background worker
body: <p>While my background worker is doing his job, I want to change a label in main form telling what process is taking in that time.</p>
  
  <p>The app works with some files, so I need to pass the information of the file the app is working on.</p>
  
  <p>My Background Worker</p>
  
  <pre><code>    Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
      If (Not System.IO.Directory.Exists(caminho &amp; "\results")) Then
          System.IO.Directory.CreateDirectory(caminho &amp; "\results")
      End If
      For Each folder As String In System.IO.Directory.GetDirectories(caminho)
          Dim split As String() = folder.Split("\")
          Dim parentFolder As String = split(split.Length - 1)
          If (Not System.IO.Directory.Exists(caminho &amp; "\results" &amp; "\" &amp; parentFolder)) Then
              System.IO.Directory.CreateDirectory(caminho &amp; "\results" &amp; "\" &amp; parentFolder)
          End If
          For Each file As String In System.IO.Directory.GetFiles(folder)
              output = file
              'Dim imgFile As System.Drawing.Image = System.Drawing.Image.FromFile(file)
              Dim thumbimage As Bitmap
              Dim originalimage As Bitmap
  
              Dim width As Integer = TextBox2.Text '# this is the max width of the new image
              Dim height As Integer = TextBox3.Text '# this is the max height of the new image
  
              originalimage = System.Drawing.Image.FromFile(file)
  
              thumbimage = New Bitmap(width, height)
              Dim novonome As String = Path.GetFileNameWithoutExtension(file)
  
              Dim gr As Graphics = Graphics.FromImage(thumbimage)
              gr.DrawImage(originalimage, 0, 0, width, height)
  
              thumbimage.Save(caminho &amp; "\results" &amp; "\" &amp; parentFolder &amp; "\" &amp; novonome &amp; ".png", Imaging.ImageFormat.Png)
              thumbimage.Dispose()
              originalimage.Dispose()
          Next
      Next
  End Sub
  </code></pre>
  
  <p>My On Progress Change:</p>
  
  <pre><code>    Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
      Label3.Text = "Working file " &amp; output
  End Sub
  </code></pre>
  
  <p>Isn't supposed to change the label3.text in form1 with the file it's working? Basically nothing happens to label3.</p>
  
  <p>My output var is declared under Public Class Form1.</p>
  
  <p>Thanks in advance.</p>