c#在线程中调用窗口控件2(带参数)
2014-06-01 21:47
232 查看
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string ss = "我是要传入的字符串"; //开启线程(带参数) ThreadPool.QueueUserWorkItem(new WaitCallback(aa), ss); } void aa(object o) { //线程中调用控件 textBox1.BeginInvoke(new System.EventHandler(bb), o); } void bb(object o, EventArgs e) { textBox1.Text = o.ToString(); } } }
相关文章推荐
- c#在线程中调用窗口控件
- C#线程调用带参数的方法,给控件赋值
- ie窗口之间的无刷新传参数,c#后台代码调用前台js代码
- C#线程调用带参数的方法 ~
- [C#]线程调用带参数的方法 转
- C#跨线程调用窗体控件
- C# 线程调用主线程中的控件
- C#线程调用带参数的方法
- C#线程调用带参数的方法
- C#线程调用带参数的方法 ~
- C# WinForm编程:跨线程调用UI窗口控件
- C#线程调用带参数的方法 ~
- C#线程调用带参数的方法
- .net C# 跨越线程调用窗体上的控件一个完整的例子
- 转:C#线程调用带参数的方法
- C#线程调用带参数的方法 ~
- C#线程调用带参数的方法
- WPF中窗口控件的跨线程调用
- C#跨线程窗口调用
- c#中如何跨线程调用windows控件