using System.Threading;
Thread th;
private void button1_Click(object sender,EventArgs e)
{
th=new Thread(new ThreadStart(ThreadAdd));
th.Start();
}
private delegate void MyDelegate();
private void ThreadAdd()
{
textBox1.Invoke(new MyDelegate(Add));
}
private void Add()
{
int sum=0;
for(int i=1;i<=100;i++)
{
sum+=i;
}
textBox1.Text=sum.ToString();
}
你要几个线程?