I'm starting by just testing folders. I've set up an event handler for the dragEnter and dragLeave events. When I drag a folder over the form the dragOver event handler confirms that the data being dragged is actually a folder and returns either true or false. The dragLeave handler then displays all the files in that folder when I let go of the mouse. The problem here is that while letting go of the mouse completes the drag and drop, so does dragging my mouse outside the form's bounds. I need a way to confirm that the data was actually dropped onto the form.
I've tried the DragDrop event, but it doesn't seem to do anything. I tried this simple code:
Expand|Select|Wrap|Line Numbers
- private void Form1_DragDrop(object sender, DragEventArgs e)
- {
- MessageBox.Show("Data was dropped");
- }
So how can I get the program to only process the information if the data was actually dropped onto the form, and not if it was dragged onto then out of the form?