Hello.
I'm having a bit of difficulty implementing Drag and Drop.
The scenario is this.
I have a project with an MDI child where I want to drop documents from Windows Explorer.
The code is all in place (this is just for debugging purposes) and I have set AllowDrop to True for the form.
Private Sub Registrations_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.All
End If
End Sub
Private Sub Registrations_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim files() As String
files = e.Data.GetData(DataFormats.FileDrop)
End If
End Sub
But whenever I grab onto a file and drag it onto the form, I get the "Not Here" cursor (you know, the circle with a slash through it), and thus cannot drop the file.
What am I missing?
I'm using Visual Studio 2008 Pro in Windows 7, if that has anything to do with it.