title: Running a method in BackGroundWorker and Showing ProgressBar
body: <p>What I want is when some method is doing some task UI keeps itself active and I want to show the progress of the work in a progress-bar.</p>
  
  <p>I have a method, a <code>BackGroundWorker</code> and a <code>Progressbar</code>. I want to call the method when <code>BackGroundWorker</code> starts running and show the progress. The method contains a loop. So, it can report the progress.</p>
  
  <p>So, what can be done?</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
  {
      // TODO: This line of code loads data into the 'dataSet1.TBLMARKET' table. You can move, or remove it, as needed.
      myBGWorker.WorkerReportsProgress = true;
  }
  
  private void myBGWorker_DoWork(object sender, DoWorkEventArgs e)
  {
      parseFiles();
  }
  
  private void myBGWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
  {
      myProgressBar.Value = e.ProgressPercentage;
  }
  
  private void myBGWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
  {
      MessageBox.Show("Done");
  }
  
  private void parseButton_Click(object sender, EventArgs e)
  {
      myBGWorker.RunWorkerAsync();
  }
  
  public void parseFiles()
  {
    for()
    {
       //parsing
       myBGWorker.ReportProgress(...);
    }
  }
  </code></pre>
  
  <p>But it's not working. The <code>Progressbar</code> is not updating. Only a small progress is showing after the <code>MessageBox</code> "Done".</p>