title: Refresh/Update text field and progress bar while running a sub in vb.net wpf application
body: <p>I have several reports that all merge onto the same datatable.  The user can click several to run and then hit the 'find records' button to run them all simultaneously.  Since they each take so long, I'd like to update the user on the status bar as each of these stored procedures is called successfully.  However, when I call the procedure, I only get one update at the very end listing everything.</p>
  
  <p>What I'd like to do :</p>
  
  <pre class="lang-vb prettyprint-override"><code>'Initialize Progress Components
  repCompleted = 0
  ProgressBar1.Minimum = 0
  ProgressBar1.Maximum = repSel
  ProgressBar1.Value = repCompleted
  TextBlock2.Text = repCompleted &amp; " of " &amp; repSel &amp; " reports finished"
  </code></pre>
  
  <p>Then as each report gets successfully run, update the <code>repCompleted</code> value and refresh</p>
  
  <pre><code>repCompleted += 1
  TextBlock2.Text = repCompleted &amp; " of " &amp; repSel &amp; " reports finished"
  ProgressBar1.Value = repCompleted
  </code></pre>
  
  <p>The problem is that these refreshes don't happen until I've exited the sub.  I'd like it to count forward as each one finishes i.e. <code>1 of 4 completed</code>, <code>2 of 4 completed</code>, etc.</p>
  
  <p>Any ideas?</p>