委托

private delegate void UpdateDGV_AddRes_CallBack(Int32 i,bool Res);

函数实现

private void UpdateDGV_DevAddResult(Int32 i, bool Res)
{
if (this.DGV_DevAddResult.InvokeRequired)
{
UpdateDGV_AddRes_CallBack d = new UpdateDGV_AddRes_CallBack(UpdateDGV_DevAddResult);
this.Invoke(d, new object[] { i ,Res});
}
else
{
//具体功能代码...
//如,textbox1.text=“hello,world” }
}

子线程这样调用:

UpdateDGV_DevAddResult(i,Res);
05-11 22:17
查看更多