VB Code:
Private Sub Command1_Click()
Dim strFileName As String 'the file name
Dim strFolder As String 'the dir to search
Dim strExt As String 'the file extension
'test
strFolder = "C:\Winnt"
'add the trailing slash if it's not their
If Right(strFolder, 1) <> "\" Then strFolder = strFolder & "\"
strFileName = Dir(strFolder)
While strFileName <> ""
strExt = LCase(Right(strFileName, 4))
If (strExt = ".jpg") Or (strExt = ".bmp") Then
List1.AddItem strFolder & strFileName
End If
strFileName = Dir
Wend
End Sub