View Single Post
 
Old 04-09-2014, 07:01 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Should be simple enough

If I understand you correctly, it is the "Drag Drop" part you are having difficulties with. All you need to do is:

Set the forms "AllowDrop" property to True.

Add this in the codebehind:

Code:
Private Sub Form1_DragDrop(sender As Object, e As DragEventArgs) Handles Me.DragDrop
        Dim AllFiles() As String = e.Data.GetData(DataFormats.FileDrop)
        For Each s as string In AllFiles
            ' variable s now holds the path to the file. The "For each" handles dropping several files at once
        Next
    End Sub

    Private Sub Form1_DragEnter(sender As Object, e As DragEventArgs) Handles Me.DragEnter
        If e.Data.GetDataPresent(DataFormats.FileDrop) Then
            e.Effect = DragDropEffects.Copy
        End If
    End Sub
Reply With Quote