title: C# cross-thread call problem
body: <p>I'm writing a form app in c# and I need to be able to change the contents of a Rich Text Box from any thread, I tried using a <strong>delegate</strong> and <strong>InvokeRequired</strong>, but the delegate I made still gives me a cross-thread call error, and InvokeRequired crashes the form, without giving an error.
  Function I need to be able to execute from any thread:</p>
  
  <pre><code>    public static void updateSub(int what)
      {
          subDisplay.subBox.Text = tb[what];
      }
  </code></pre>
  
  <p>The delegate I tried to use:</p>
  
  <pre><code>    public delegate void UpdateDelegateVoid(int what);
      static public UpdateDelegateVoid uSub = new UpdateDelegateVoid(updateSub);
      uSub(0);
  </code></pre>
  
  <p>My InvokeRequired code:</p>
  
  <pre><code>    public static void updateSub(int what)
      {
          if (subDisplay.subBox.InvokeRequired)
          {
              subDisplay.subBox.Invoke(new MethodInvoker(finish));
          }
          else
          {
              subDisplay.subBox.Text = tb[what];
          }
      }
  </code></pre>
  
  <p>I'm not really sure why the code above isn't working. Thanks!</p>