线程间操作无效
第一种方法: //线程开始的时候加这么一句(把错误隐藏掉)
Control.CheckForIllegalCrossThreadCalls = false;
第二种方法:(建议采用)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
private delegate void ShowDelegate(string strshow);
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
public void Show(string strshow)
{
if (this.txtreceive.InvokeRequired)
{
// this.txtreceive.BeginInvoke(new ShowDelegate(Show), strshow);//这个也可以
this.txtreceive.Invoke(new ShowDelegate(Show), strshow);
}
else
{
this.txtreceive.Text += strshow;
}
}