C# 跨线程设置TextBox.Text

        delegate void SetTextCallback(string text); 
public Form1()
{
InitializeComponent();
}
public void SetText(string text)
{
if (this.textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Text = text;
}
}
原文地址:https://www.cnblogs.com/yuqilin/p/2213685.html