多线程间操作控件出错,用这个方法

                this.Invoke((EventHandler)(delegate
                {
                   
// pictureBox1.Image = img;
                    txtCode.Text =getPicStr(img);
                }));
不要再用Control.CheckForIllegalCrossThreadCalls = false;这种方法了,会有莫名其妙的错误
原文地址:https://www.cnblogs.com/icejd/p/2085421.html