Get a Image Control over your form and then try the following
Dim c, ans, pos
Dim valid As Boolean
Private Sub Form_Activate()
On Error Resume Next
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then
Unload Me
Exit Sub
End If
Image1.Width = Me.Width
Image1.Height = Me.Height
If Not Err.Number = 481 Then
Image1.Picture = LoadPicture(CommonDialog1.FileName)
Label1.Caption = Dir(CommonDialog1.FileName)
Else
valid = False
End If
If Not Left(CommonDialog1.FileName, 1) = "\" Then
ans = CurDir(CommonDialog1.FileName)
Else
ans = Dir(CommonDialog1.FileName)
ans = Mid(CommonDialog1.FileName, 1, Len(CommonDialog1.FileName) - Len(ans))
End If
ShowFileList (ans)
End Sub
Sub ShowFileList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject"

Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 In fc
If LCase(Right(f1.name, 3)) = "jpg" Or LCase(Right(f1.name, 3)) = "bmp" Or LCase(Right(f1.name, 3)) = "gif" Or LCase(Right(f1.name, 3)) = "wmf" Then
List1.AddItem (f1.name)
End If
Next
For i = 0 To List1.ListCount - 1
If List1.List(i) = Dir(CommonDialog1.FileName) Then
c = i + 1
Exit For
End If
Next
If valid = False Then
Image1_Click
valid = True
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = vbKeySpace Or KeyCode = vbKeyRight Then
c = c + 1
If c >= List1.ListCount Then
c = 0
End If
If Not Err.Number = 481 Then
Image1.Picture = LoadPicture(ans & "\" & List1.List(c))
Label1.Caption = List1.List(c)
Else
Image1_Click
End If
ElseIf KeyCode = vbKeyLeft Then
c = c - 1
If c <= 0 Then
c = List1.ListCount - 1
End If
If Not Err.Number = 481 Then
Image1.Picture = LoadPicture(ans & "\" & List1.List(c))
Label1.Caption = List1.List(c)
Else
Image1_Click
End If
ElseIf KeyCode = vbKeyEscape Then
Unload Me
End If
End Sub
Private Sub Image1_Click()
On Error Resume Next
c = c + 1
If c >= List1.ListCount Then
c = 0
End If
If Not Err.Number = 481 Then
Image1.Picture = LoadPicture(ans & "\" & List1.List(c))
Label1.Caption = List1.List(c)
Else
Image1_Click
End If
End Sub
satya