title: Reading variables by another thread - variables won't change
body: <p>So I have a problem here. I declare some variable in my class, then I try to change it and then read it with my windows form thread. The variable is being read as the initial value that it was declared with, and nothing can change it. Example:</p>
  
  <p>I declare the value in my Class1.cs:</p>
  
  <pre><code>public static int TestVar = 51;
  </code></pre>
  
  <p>Then I change the value later in that same class to for example 45:</p>
  
  <pre><code>TestVar = 45;
  </code></pre>
  
  <p>Then I read the variable from my windows form thread like this:</p>
  
  <pre><code>label1.Text = Class1.TestVar.ToString();
  </code></pre>
  
  <p>And the result in my windows form is 51 instead of 45. It doesn't matter if I declare it to 0 or without any initial value. It will just stay as 0 instead.</p>
  
  <p>The class it has been declared it reads the variable fine as 45, somehow the other thread doesn't have it updated.</p>
  
  <p>The windows form is being run using:</p>
  
  <pre><code>public void RunThread()
  {
      Thread thread = new Thread(new ThreadStart(RunForm));
      thread.Name = "NewForm";
      thread.Start();
  }
  
  public void RunForm()
  {
      Application.Run(new NewForm());
  }
  </code></pre>
  
  <p>Any help?</p>