private void Form1_Load(object sender, EventArgs e)
{
System.Threading.Thread thread = new System.Threading.Thread(CrossThreadFlush);
thread.IsBackground = true;
thread.Start();
}
private void CrossThreadFlush()
{
while (true)
{
if (richTextBox1 != null)
{
richTextBox1.BeginInvoke(new Action(() =>
{
richTextBox1.AppendText("11111\r\n");
}));
}
System.Threading.Thread.Sleep(100);
}
}
标签:控件,thread,Thread,System,richTextBox1,Threading,线程,操作
From: https://www.cnblogs.com/yuan99977/p/17765462.html