我得到了这段运行.exe的代码
string openEXE = @"C:\Users\marek\Documents\Visual Studio 2012\Projects\tours\tours\bin\Debug\netpokl.exe";
                 Process b = Process.Start(openEXE);
                 b.EnableRaisingEvents = true;
                 b.Exited += (netpokl_Closed);当它关闭时,它会调用netpokl_Closed方法。问题是,当I insert into netpokl_Closed command - this.Close()时,这个异常会上升:Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
我怎么才能修复它?感谢您的时间和答案。
发布于 2013-08-19 16:52:11
您可以使用Delegate关闭表单
      public delegate void CloseDelagate(); 
      Form1.Invoke(new CloseDelegate(Form2.Close));https://stackoverflow.com/questions/18309785
复制相似问题