Search code examples
c#winformslistviewevent-handlingtreeview

c# MouseUp is ignored while dragging an item to another panel


I am trying drag an item from an ItemList to my TreeList. I wrote listView1_MouseDown, listView1_MouseMove, treeView1_MouseMove and treeView1_MouseUp functions. When I move the mouse within treeView1 borders, MouseMove event is handled as it was supposed to. But MouseUp doesn't fire. Am I doing something wrong?


Solution

  • As far as I remember, MouseUp event is sent to the same control as MouseDown was sent to. So, in your case, your listView1 will receive MouseUp.

    You might want to look into some other events, like DragDrop.