Recently, I tried to use multithreading in winform, and I copied a piece of code online. Unexpectedly, this code runs normally on my computer, and there is no cross-thread access exception. I want to figure out why. I use the .net4.0 csc compiler to build the program, win7 ultimate sp1. My particle code is as follows
public void button_1Click(object sender,EventArgs e)
{
Thread t = new Thread(calc);
t.Start();
}
public void calc()
{
string text ="";
for(i=1;i<=1000000;i++)
{text += i.ToString();}
this.textbox_1.Text = text;
}