Drag and Drop on controls in VB.NET - DragOver, MouseUp, etc.
Posted on 2008-06-10
I am attempting to write a program that allows the user to click on one control (a button) and drag across the form to another control (another button) and drop. I'm creating the buttons dynamically, and adding the event handlers when I create the buttons.
My question is, how do I determine which control the "drop" was on? When I mousedown on the 1st button, the sender is the 1st button, and I was storing that button's ID as ID1. Then, when I drag and drop onto button 2, I was trying to do a DragOver event and store ID2 as the sender in that event, but it doesn't always work. I've tried several events and can't seem to get the right combination.
These points are for the person that puts me in the right direction with links, etc. I will increase the points if you can give me a total solution here.