Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As _ System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim MyFiles() As String Dim i As Integer ' Assign the files to an array. MyFiles = e.Data.GetData(DataFormats.FileDrop) ' Loop through the array and add the files to the list. For i = 0 To MyFiles.Length - 1 ListBox1.Items.Add(MyFiles(i)) Next End If End Sub Private Sub ListView1_DragEnter(ByVal sender As Object, ByVal e As _ System.Windows.Forms.DragEventArgs) Handles ListView1.DragEnter If e.Data.GetDataPresent(DataFormats.FileDrop) Then e.Effect = DragDropEffects.All End If End Sub Private Sub ListView1_DragDrop(ByVal sender As Object, ByVal e As _ System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim MyFiles() As String Dim i As Integer ' Assign the files to an array. MyFiles = e.Data.GetData(DataFormats.FileDrop) ' Loop through the array and add the files to the list. For i = 0 To MyFiles.Length - 1 ImageList1 = e.Data.GetData(DataFormats.Bitmap) ListView1.LargeImageList = ImageList1 ListView1.Items.Add(MyFiles(i)) Next End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)