C#线程调用带参数的方法,给控件赋值
生活随笔
收集整理的這篇文章主要介紹了
C#线程调用带参数的方法,给控件赋值
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
System.Threading.Thread thread = new System.Threading.Thread(() =>
{
//各種業務
//定義一個委托
public delegate void ProcessDelegate(string a);
if (this.lbStatus.InvokeRequired)
{
ProcessDelegate df = new ProcessDelegate(AddStatus);
this.Invoke(df, new object []{ "調用Web Service過程產生錯誤:" + ls_ErrMsg });
}
});
thread.IsBackground = true;
thread.Start;
----以上自己修改,親測可以使用
參考自 :?http://www.jb51.net/article/56428.htm
?
轉載于:https://www.cnblogs.com/liwp/p/7241165.html
總結
以上是生活随笔為你收集整理的C#线程调用带参数的方法,给控件赋值的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows Server 2012
- 下一篇: 一般什么人会梦到龙