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方法很少出问题。

 

相关文章:

  • 2021-09-01
  • 2021-09-29
  • 2021-06-25
  • 2021-07-18
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2021-11-29
  • 2021-08-23
  • 2021-10-30
  • 2021-11-18
  • 2021-04-04
  • 2022-01-05
相关资源
相似解决方案