title: Invoking control hanging application
body: <p>Following from this question: <a href="https://stackoverflow.com/questions/10775367/cross-thread-operation-not-valid-control-textbox1-accessed-from-a-thread-othe">Cross-thread operation not valid: Control &#39;textBox1&#39; accessed from a thread other than the thread it was created on</a></p>
  
  <p>I have created a helper class to wrap up the procedure:</p>
  
  <pre><code>public class FormObject
  {
      private readonly Form _referenceForm;
      public delegate void SetTextCallback(string text);
      private readonly Control _control;
  
      public FormObject(Form referenceForm, Control control)
      {
          _referenceForm = referenceForm;
          _control = control;
      }
  
      public void WriteToControl(string text)
      {
          if (_control.InvokeRequired)
          {
              SetTextCallback d = WriteToControl;
              _referenceForm.Invoke(d, new object[] { text });
          }
          else
          {
              _control.Text = text;
          }
      }
  }
  </code></pre>
  
  <p>Which I call like so:</p>
  
  <pre><code>FormObject fo = new FormObject(this, txtOutput);
  fo.WriteToControl("message");
  </code></pre>
  
  <p>However, the app hangs on the following line:</p>
  
  <p><code>_referenceForm.Invoke(d, new object[] { text });</code></p>
  
  <p>There is no error thrown, and waiting doesn't do anything . What am I not seeing here?</p>
  
  <p>-- Edit --<br>
  For context, this is a client TCP application connecting to a TCP server. I want to display the resulting message received from the server into the <code>txtOutput</code>.</p>
  
  <p>The application loads and runs correctly, and this invoking call only gets called on a button click.</p>
  
  <p>Here is my current threads when I approach the Invoke:</p>
  
  <p><img src="https://i.stack.imgur.com/OqDLd.png" alt="enter image description here"></p>