我正在使用它来将文本写回textbox1
,并且它可以正常工作以避免跨线程操作,但是......我只收到一行输出。知道如何进行更多的AppendText
通话而不是基本的短信通话吗?
private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Text = text;
}
}