Public Class Form1
Private Sub form1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim DroppedFiles As String() = _
e.Data.GetData(DataFormats.FileDrop)
For i As Int32 = 0 To DroppedFiles.Length - 1
PictureBox1.ImageLocation = DroppedFiles(i)
Next
End If
End Sub
Private Sub form1_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 Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.AllowDrop = True
End Sub
End Class