Illegal Cross Thread Operation error
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/606642/help-needed-for-cross-thread-operation-error-in-c-sharp">Help needed for &#39;cross-thread operation error&#39; in C#</a><br>
  <a href="http://stackoverflow.com/questions/5868783/solve-a-cross-threading-exception-in-winforms">Solve a cross-threading Exception in WinForms</a>  </p>
</blockquote>



<p>I've tried to add progressbar in the foreach-loop</p>

<pre><code>private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
    foreach (...)
    {
        ...
        i++;
        backgroundWorker1.ReportProgress(100 * i / rcount);
        Thread.Sleep(100);
    }
    this.close();
}
</code></pre>

<p>now i have an Illegal Cross Thread Operation error in 
<code>this.close();</code>
 line</p>

<p>How can i solve it?</p>
