title: How do you set a component property from within a thread without throwing an error in C# .NET?
body: <p>I have a user interface which needs to be updated by a function running in a <code>backgroundworker</code> (a different thread from the primary one).</p>
  
  <p>I would like to <strong>effectively</strong> be able to do the following without throwing an exception:</p>
  
  <pre><code>    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
      {
          MyProgresssbar.value = val;
          MyLabel.text = "Still going...";
      }
  </code></pre>
  
  <p>For example, could a delegate function be written that sets a component property (I don't want to have a function for each property change).</p>
  
  <p>Thanks in advance.</p>