
private void SetTextBox(string s)
...{
this.textBox1.Text += s;
}
delegate void SetText(string s);
private void Test()
...{
SetText Stxt = new SetText(SetTextBox);
for(int i=0;i<=100;i++)
...{
this.Invoke(Stxt, "内容:"+i.ToString());
}
}

private void button1_Click(object sender, EventArgs e)
...{
Sth = new Thread(new ThreadStart(Test));
Sth.Start();
}
C# UI线程调用示例
892

被折叠的 条评论
为什么被折叠?



