{
this.lblV.Text=data;
}),this.txtV.Text);
});
thread.IsBackground= true;
thread.Start();
}
1,跨线程访问组件:
if(this.lblResult1.InvokeRequired)
{
this.lblResult1.Invoke(
new Action<string>(data=>{this.lblResult1.Text=data;}),
i.Tostring()
);
}
2,read control value crossing thread
private void btnRead_Click(object sender,EventArgs e)
{
Thread thread = new Thread(()=>
{
this.txtV.Invoke(new Action<string>(data=>
{
this.lblV.Text=data;
}),this.txtV.Text);
});
thread.IsBackground= true;
thread.Start();
}
标签:074,thread,C#,Text,lblResult1,new,txtV,data,052 From: https://blog.51cto.com/u_15451880/6769333