Run method after progress bar reaches 100%
<p>I'm using below code to call <code>writecsv()</code> method. </p>

<pre><code>if (read_success == true &amp;&amp; global_variables.csvtext == "not found")
               {

                   writecsv(null, null);

               }
</code></pre>

<p>What I want to do is, I need to show a progress bar on the windows form and once it reaches 100% (in around 4 seconds) i want to call <code>writecsv()</code> method. </p>

<p>Below is the code I used for the progress bar. </p>

<pre><code>csvprogressbar.Maximum = 10000;
                   csvprogressbar.Step = 1;
                   csvprogressbar.Value = 0;
                   for (int i = 0; i &lt; 10000; i++)
                   {
                       csvprogressbar.Value = i;
                   }
</code></pre>

<p>I searched through the Internet but could not find a clear code. </p>

<p>I'm fairly new to programming with C# so I'd really appreciate if someone could help me on this. </p>

<p>Cheers. </p>