You've been tinkering with threading.  Drag+Drop doesn't like threads.  It will only work on threads that are properly initialized with Thread.SetApartmentState() to select STA and that pump a message loop with Application.Run() or Form.ShowDialog().

1、加[STAThread]

2、Thread t = new Thread(new ThreadStart(A));
   t.SetApartmentState(ApartmentState.STA);
   t.Start( );

   并不能加[STAThread]

有时加[STAThread]这个都会出现问题,不知道是不是Application.Run()上没有做好,但用2方法很少出问题。

 

相关文章:

  • 2020-09-26
  • 2021-12-15
  • 2021-12-05
  • 2021-09-05
  • 2021-11-30
  • 2021-09-04
  • 2021-11-13
  • 2021-09-06
猜你喜欢
  • 2021-11-18
  • 2021-11-03
  • 2021-08-09
  • 2021-11-07
  • 2021-11-20
  • 2021-10-17
  • 2021-12-09
  • 2021-09-19
相关资源
相似解决方案