C# 从子线程中调用主线程的窗体 疑惑
这样的,主窗体为Form1,新开了一个线程如下:
Thread History = new Thread(new ThreadStart(Ergodic));
History.Priority = ThreadPriority.Highest;
History.IsBackground = true;
History.Start();
其中Ergodic()
{
Wind_show ws = new Wind_show();
ws.ShowLidarWind_CAPPIbmp();
ws.MdiParent = this;//因为想把它弄成子窗体,但是一加上这句就报错:线程间操作无效:从不是创建控件"Form1"的线程访问它
ws.showDialog();
}
ws.MdiParent = this;因为这还是在主窗体下,this应该不会有错吧
如果想要子窗体,线程间该如何访问