在一个线程中操作窗体线程的控件

Delegate void AppendStringDelegate(string str);

 Private void AppendString(string str)

 { If(richTexBox1.InvokeRequired)

       { AppendStringDelegate d=new AppendStringDelgate(AppendString);

        richTexBox1.Invoke(d,”abc”); }

    Else { richTextBox1.Text+=str; } 

}

猜你喜欢

转载自blog.csdn.net/pingy_de/article/details/44279525