title: C# Put string into TextBox
body: <p>I want to show the results of this code in my TextBox:</p>
  
  <pre><code>       string txtout1 = txtOrgText.Text.Replace(parm, txtTo.Text).ToString();
         txtout = txtout1;
  </code></pre>
  
  <p>I have a textbox, <code>txtOrgtext</code>, into which the user inputs text. I want to put some text into txtout now.
  I have set txtout to ReadOnly and MultiLine.</p>
  
  <p>When I try running my program, I get the following error:</p>
  
  <pre><code>Error   1   Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'   C:\Users\xxx\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 45  25  WindowsFormsApplication1
  </code></pre>
  
  <p>I tried <code>txtout1.ToString()</code>, but nothing changes.</p>
  
  <p>I also tried <code>txtout.Text = txtout1</code> and get this error :</p>
  
  <pre><code>Cross-thread operation not valid: 
  Control 'txtout' accessed from a thread other than the thread it was created on.
  </code></pre>
  
  <p>I got an error because I used Threading, without Threading it works fine.</p>