1

I have a small and simple Winform app which contains a Textbox with the AllowDrop property set to true. I'm handling the DragDrop and DragEnter events as such:

Private Sub txtFile_DragEnter(sender As Object, e As DragEventArgs) Handles txtFile.DragEnter
    If e.Data.GetDataPresent(DataFormats.FileDrop) Then
        e.Effect = DragDropEffects.Copy
    End If
End Sub

Private Sub txtFile_DragDrop(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles txtFile.DragDrop
    Dim files() As String = e.Data.GetData(DataFormats.FileDrop)
    If Not files Is Nothing AndAlso files.Length > 0 Then
        txtFile.Text = files.First()
    End If
End Sub

The problem I'm having is that the textbox will not accept a file drop when I F5 debug, instead I get the 'No' cursor. If I end debugging and run the executable from the /bin folder, it works as expected.

Is there something specific about Visual Studio debugging which would prevent filedrops from working, or do I need to change any code for debugging?

InbetweenWeekends
  • 1,405
  • 3
  • 23
  • 28
  • 2
    I'm using VS Community 2013 and it allows me to drag and drop a file while running from the IDE. You may be running into a [UAC](http://stackoverflow.com/q/15226600/2330053) type problem? – Idle_Mind Jun 24 '15 at 14:56
  • I promise I searched. It was indeed a UAC problem. Thanks. – InbetweenWeekends Jun 24 '15 at 15:07

0 Answers0