DragDrop registration did not succeed

前端 未结 9 1770
时光取名叫无心
时光取名叫无心 2021-02-07 08:14

System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException:

What does this except

9条回答
  •  囚心锁ツ
    2021-02-07 08:40

    I have encountered this situation recently,[STAThreadAttribute]is in my case,and i solved this problem by using Invoke method,it might be helpful for you guys,so I share with a little code snippet:

    this.Invoke(new InvokeHandler(delegate() 
    {
    //Your method here!
    }));
    

    And InvokeHandler is a delegate like this:

    private delegate void InvokeHandler();
    

提交回复
热议问题