title: Set value of label with C# Cross Threading
body: <p>I need help with setting/changing the value of a label in my C# program whenever I try it an error occurs saying I need to cross thread it all. Can anyone write some code to help me with that?
  My code is:</p>
  
  <pre><code>int number = 0;
  int repeats = Convert.ToInt32(textBox2.Text);
  
  while (number &lt; repeats)
  {
     repeats++;
     label5.Text = "Requested" + repeats + "Times";
  }
  </code></pre>
  
  <p>Can anyone help me?
  Thanks.</p>