title: Shortest way to write a thread-safe access method to a windows forms control
body: <p>In this article:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx" rel="noreferrer"><a href="http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms171728(VS.80).aspx</a></a></p>
  
  <p>The author uses the following method to make thread-safe calls to a Windows Forms control:</p>
  
  <pre><code>private void SetText(string text)
  {
      // InvokeRequired required compares the thread ID of the
      // calling thread to the thread ID of the creating thread.
      // If these threads are different, it returns true.
      if (this.textBox1.InvokeRequired)
      {    
          SetTextCallback d = new SetTextCallback(SetText);
          this.Invoke(d, new object[] { text });
      }
      else
      {
          this.textBox1.Text = text;
      }
  }
  </code></pre>
  
  <p>Is there a shorter way to accomplish the same thing?</p>