C# Forms add text to textbox from other class
<p>I have a C# Form called Form1.cs and a Class in the same project called RandWord.cs.</p>

<p>Now I want to add text to the textbox (tbRandom) from the class.</p>

<p>I added the following code to Form1.cs:</p>

<pre><code>    public TextBox tbRandom;
</code></pre>

<p>And the following code to the class:</p>

<pre><code>public RandWord()
{
   //get linecount
   int linesGerman = File.ReadAllLines(pathGerman).Length;
   int linesFrance = File.ReadAllLines(pathFrance).Length;
   //check if same linecount
   if (linesGerman == linesFrance)
   {
      //new random int
      Random rnd = new Random();
      int rndLine = rnd.Next(1, File.ReadAllLines(pathGerman).Length);
      //write to Form1's Textbox tbWord
      f1.tbRandom.Text = rndLine.ToString();
      MessageBox.Show(rndLine.ToString());
   }
}
</code></pre>

<p>The messagebox is just there to prove that the Int is not empty. But the textbox won't display anything. There is no Exception aswell. The class is called by a button ( RandWord(); )</p>

<p>Any ideas?</p>