locked
VS2015: Dragdrop fires after treeview selection, even if left mousebutton not down RRS feed

  • Question

  • I recently implemented drag-drop from a treeview to desktop in my application (WinForms). There are also handlers for dragdrop events on the treeview itself, as well as a listview that is already present on the page (that functionality existed before I allowed for filedrop onto the desktop). 

    The problem I'm having is that if, in the treeview, you click on a node, then release the left mousebutton, the drag operation seems to still occur. If I move the mouse (left button up) over the rest of the treeview, it tries to Drop the clicked node onto the node hovered over. 

    Why isn't it looking for whether the mouse button is depressed or not? Is there some way to tell it "hey, if you're being hovered over, and the mousebutton is not depressed, don't drop?"

    Thanks for any info.
    Wednesday, September 7, 2016 3:33 PM

Answers

  • Hi Brian,

    Thank you for posting in MSDN forum.

    For reproducing this issue, I create a WinForm application, once I move the mouse, the dragdrop action stopped. this app works fine here:

    Currently, we couldn't determine if the cause is related to your VS or your operating system slow.

    You could try to replicate and import that scene into a new project or a new machine, to see if it is the same situation shows.

    Then how about checking your OS running first, if the CPU taking memory is high, please go to Task Manager to kill some software and application you rarely use.

    If the problem still persists, please feel free to tell us and we will try to figure out the reason why.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    • Proposed as answer by 宝宝徐 Friday, September 9, 2016 1:41 AM
    • Marked as answer by 宝宝徐 Wednesday, September 14, 2016 1:01 AM
    Thursday, September 8, 2016 8:10 AM