title: How to update the progress bar in runtime using c#
body: <p>I am using the below code to update my progress bar.</p>
  
  <pre><code>        ProgressBar.Visible = true; 
          ProgressBar.Minimum = 1; 
          ProgressBar.Maximum = PortCount; 
          ProgressBar.Value = 1; 
          ProgressBar.Step = 1; 
  
          int intdata = 5;
          for (int x = 1; x &lt;= intdata; x++)
            {
              ProgressBar.PerformStep();
          }
  
          MessageBox.Show("Done");
  </code></pre>
  
  <p>But, it is not getting updated during runtime. Is it because the progress bar is in the same thread. If so, how to update this progress from another thread. Help...</p>