views:

16

answers:

1

I am trying to drag and drop a file onto a control in my application. The problem is that when you hold the mouse button down (i.e. dragging from widows explorer), my app does not fire any of the form events. They all work fine if the mouse is not down. Is appears that I need to enable the 'AllowDrop' for the application (it is enabled on the form)

What am I missing?

I am developing in vb.net 2008 in windows 7 environment

A: 

AllowDrop needs to be enable for the control/object you intend to drop on.

You also need to update the DragDropEffects in either the Enter or DragOver event. This allows you to validate and provide feedback for supported or unsupported drop items.

Private Sub UserControl11_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles UserControl11.DragEnter e.Effect = DragDropEffects.All

End Sub

eschneider