title: reportProgress in backgroundWorker not work until operation completed
body: <p>When I call worker.ReportProgress() in the <code>BackgroundWorker.DoWork</code> Event, it won't work and the <code>ProgressChanged</code> event is only raised at the end of the <code>for</code> loop.</p>
  
  <pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
  {
      string writePath = Path.Combine(bookPath, "bytes");
      DataTable dt = new DataTable();
      dt = Form1.book.Select("select * from book");
      Directory.CreateDirectory(writePath);
      foreach (DataRow dr in dt.Rows)
      {
          int pagenumber = Convert.ToInt32(dr["pageNumber"]);
          string text = dr["text"].toString();
          byte[] codes = tocode.convertTobyte(text.ToCharArray());
  
          File.WriteAllBytes(Path.Combine(writePath, pagenumber.ToString()),codes);
          backgroundWorker1.ReportProgress((pagenumber * 100) / dt.Rows.Count);
      }
  }
  
  private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
  {
       progressBarMain.Value = e.ProgressPercentage;
  }
  </code></pre>