title: Updating progress bar in loop
body: <p>I have a method <code>getPlugins</code> that takes quite a long time to run. Essentially it's parsing a very large log file. I know the log file goes from time 0 to time 24. I would like to update a <code>ProgressBar</code> based on the current time. Here's the structure of my code, but the bar only seems to be updated once my loop is finished... How can I fix this?</p>
  
  <pre><code>private void getPlugins(String filePath)
  {
       var w = new Window2();
       w.Show();
       w.progress.Value = 0;
  
       List&lt;String&gt; pluginNames = new List&lt;String&gt;();
  
       string strLine;
  
       // Read the file and display it line by line.
       System.IO.StreamReader file = new System.IO.StreamReader(filePath);
  
        while ((strLine = file.ReadLine()) != null)
        {
            // Do stuff....
  
            float time; // Here I have time as a float from 0 to 24
            w.progress.Value = time;
        }
  
        file.Close();
        w.progress.Value = 24;
        w.Close();
  }
  </code></pre>