'This Declarations are used in Option Explicit of the form
'If you need to use them in the Module You have to
'use keyword Public before Type
'and Public Before Daclare

Option Explicit

Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * 260
cAlternate As String * 14
End Type

Declare Function FindClose Lib "kernel32.dll" (ByVal hFindFile As Long) As Long

Declare Function FindNextFile Lib "kernel32.dll" Alias "FindNextFileA" (ByVal hFindFile As _
Long, lpFindFileData As WIN32_FIND_DATA) As Long

Declare Function FindFirstFile Lib "kernel32.dll" Alias "FindFirstFileA" _
(ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long

'*********************************************
'on any event that you need, this is the code
'Pretend that this is cmdShow_Clik()
'**********************************************
'First Declare all local variables

Dim hsearch As Long ' handle to the file search
Dim findinfo As WIN32_FIND_DATA
Dim success As Long
Dim buffer As String
Dim retval As Long
Dim i As Integer
dim DirPath as string

' Begin a file search:
'If you have your picture files in "C:\MyPictures"
'you have to use "\" that separates Directory from Files

DirPath="C:\MyPictures\"
'The Function FindFirstFile works with 2 parameters
'first is a path of the file in your case it is DirPath & "*.bmp"
'second is a user define type

hsearch = FindFirstFile(DirPath & "*.bmp", findinfo)

If hsearch = -1 Then
exit sub
End If

Do ' begin loop
buffer = Left(findinfo.cFileName, InStr(findinfo.cFileName, vbNullChar) - 1)

i = i + 1
Load Image1(i)
Image1(i) = LoadPicture(DirPath & buffer)
Image1(i).Top = Image1(i - 1).Top + Image1(i - 1).Width + 50
Image1(i).Visible = True
success = FindNextFile(hsearch, findinfo)
Loop Until success = 0


retval = FindClose(hsearch)