DragDrop registration failed
-
I get this error "DragDrop registration failed" when setting the AllowDrop property in a control. Im accessing a control from a different thread than the one that created the control. I use invoke when adding and removing,, the problem is i dont know if i have to invoke the dragdrop event or how it should be done.
-
I get this error "DragDrop registration failed" when setting the AllowDrop property in a control. Im accessing a control from a different thread than the one that created the control. I use invoke when adding and removing,, the problem is i dont know if i have to invoke the dragdrop event or how it should be done.
Drag and drop registration must be performed on the STA thread, so it must be called from the thread on which the control was created. If you're setting the
AllowDrop
property from a different thread, useInvoke
for that as well, getting theget
accessor using Reflection and creating a delegate that matches the signature. CallControl.Invoke
using that delegate that references theget
accessor method.Microsoft MVP, Visual C# My Articles