线程,

private void SetValue()
{
int a = 0;
for(int i=0;i<2000;i++)
{
a += i;

}
if(textBox1.InvokeRequired)
{
textBox1.Invoke(new Action<string, TextBox>(Value), a.ToString(), textBox1);
}
}
private void Value(string s,TextBox txt)
{
txt.Text = s;
}

 

posted @ 2015-11-15 20:04  caichao  阅读(86)  评论(0编辑  收藏  举报