Dim fs As New List(Of String)
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.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub Form1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Me.DragDrop
Dim FileNames As String() = CType(e.Data.GetData(DataFormats.FileDrop, False), String())
Dim files As String()
Dim Extes() As String = {"*.ai", "*.eps"}
Dim Exte As String = String.Empty
Me.Refresh()
For Each FName As String In FileNames
If GetAttr(FName) = FileAttribute.Directory Then
For Each Exte In Extes
files = System.IO.Directory.GetFiles(FName, Exte)
For Each FileName As String In files
ContAdd(FileName)
Next
Next
Else
For Each Exte In Extes
If Path.GetExtension(FName) = Microsoft.VisualBasic.Right(Exte, Len(Exte) - 1) Then
ContAdd(FName)
End If
Next
End If
Next
If fs.Count > 0 Then
fs.Sort()
ListBox1.Items.Clear()
For Each aaa As String In fs
ListBox1.Items.Add(Dir(aaa))
Next
End If
End Sub
Public Sub ContAdd(ByVal FName As String)
If fs.Contains(FName) = False Then fs.Add(FName)
End Sub