title: Program hangs on For loop when updating label
body: <p>I have this code in a winform app:</p>
  
  <pre><code>for (int i = 1; i &lt;= 20; i++)
   {
        lbl.Text = i.ToString();
        Thread.Sleep(100);
   }
  </code></pre>
  
  <p>I expected to see the label progress from 1 to 20 but instead it just hangs while the for loop is running and then displays a 20, i.e. I don't see 1-19.</p>
  
  <p>Why is this and is there a way to update the label text quickly similar to the milliseconds on an analogue clock (I'm not making a clock, just an example.)</p>
  
  <p>Thanks</p>
  
  <p>*<em>EDIT: This also happens if I have a button with an event that increments the number without Thread.Sleep but I have a beginInvoke to  play a wav file *</em> </p>