Option Explicit
Private Sub Form_Load()
File1.Path = "C:\My Documents\AAWeb" 'Path to read
File1.Pattern = "*.jpg" 'pattern to look for
End Sub
Private Sub File1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Make sure all controls have DragMode set to manual
If Button = vbLeftButton Then File1.Drag vbBeginDrag 'Start dragging
End Sub
Private Sub Image1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Dim lCounter As Integer 'Loop counter
Dim lPicture As Integer 'Picture counter
'Delete all pictures to start with
For lCounter = 0 To Image1.UBound
Image1(lCounter).Picture = LoadPicture()
Next
lPicture = 0 'First image to load picture
With File1
For lCounter = 0 To .ListCount - 1 'Loop thru all file items
If .Selected(lCounter) = True Then 'If selected
'Load that pic into first image
Image1(lPicture).Picture = LoadPicture(.Path & "\" & .List(lCounter))
lPicture = lPicture + 1 'Next pic will load into next available image
End If
Next
.Drag vbEndDrag 'Stop the dragging
End With
End Sub