Drag and Drop for injector code
I was going through the list of crap for list box, and i found drag drop and drag enter. well i figured out a way to use it, but don't know if its a good way.
Here is what i tried.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.AllowDrop = True
End Sub
Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
Dim files() As String = e.Data.GetData(DataFormats.FileDrop)
For Each path In files
Dim DllFileName As String = path
Try
dlls.Add(DllFileName, path)
ListBox1.Items.Add(DllFileName)
Catch ex As Exception
MsgBox("Please take file out of windows folder.")
End Try
Next
End Sub
Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.Copy
End If
End Sub