日期:2014-05-18 浏览次数:20491 次
delegate void SetTextCallback(string text); private void SetText(string text) { if (this.textBox1.InvokeRequired) { SetTextCallback d = new SetTextCallback(SetText); this.Invoke(d, new object[] { text }); } else { this.textBox1.Text = text; } } private void thread1(object para) { SetText("....."); } private void button1_Click(object sender, EventArgs e) { //如果要参数 //定义参数para Thread w0 = new Thread(new ParameterizedThreadStart(thread1)); w0.Start(para); }