委托,
form.invoke
form.begininvoke
Why can not I reply you in Chinese. Once I select sogou,it is handled.
As to the question,can you explain it in more details?
Thanks!
@〆.落若兮。: 我不知道你具体要实现什么功能,下面是我一个非UI线程,输出log到textBox的方法,
delegate void OneStringParmenters(string s);
/// <summary>
/// 输出日志到窗口
/// </summary>
/// <param name="strLog"></param>
public void UpdateLog(string strLog)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new OneStringParmenters(UpdateLog), strLog);
}
else
{
txtLog.AppendText(string.Format("{0}:{1}\r\n", DateTime.Now.ToString("G"), strLog));
}
}
控件交互
1、使用backgroundWorker控件
2、参考http://hi.baidu.com/yyq745201/item/1441d2dc4aff18f292a97423提出的两种方法
至于数据交互,可以使用CallContext.LogicalSetData(),详细参考http://www.cnblogs.com/heyuquan/archive/2012/12/23/2830214.html的“执行上下文”小节