Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DragDrop registration failed

DragDrop registration failed

Scheduled Pinned Locked Moved C#
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michael wikstrom
    wrote on last edited by
    #1

    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.

    H 1 Reply Last reply
    0
    • M michael wikstrom

      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.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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, use Invoke for that as well, getting the get accessor using Reflection and creating a delegate that matches the signature. Call Control.Invoke using that delegate that references the get accessor method.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups