I have written a simple vb6 slideshow to show my camera pics on a 1920 x 1080 LCD TV set via HDMI using the usual filesystemobject method. (They look fantastic)
Question:-
All the files in one folder seem to show in turn in order of date created.
Is there a way of extracting the filenames in any other given order without resorting the array afterwards? (such as alphabetically by name or size like you can with Windows explorer)
This is how I create the list for showing:-
Question:-
All the files in one folder seem to show in turn in order of date created.
Is there a way of extracting the filenames in any other given order without resorting the array afterwards? (such as alphabetically by name or size like you can with Windows explorer)
This is how I create the list for showing:-
Code:
Sub MakeFileList(FilePath as string)
Dim fs, f, f1, fc, TempFile As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Filepath)
Set fc = f.Files
Erase FileCollection
FileCount = 0
For Each f1 In fc
If FileCount < 1000 Then
TempFile = f1.Name 'read next item in folder
If LCase(Right(TempFile, 3)) = "jpg" Or LCase(Right(ThisFile, 3)) = "bmp" Then
FileCollection(FileCount) = TempFile 'put all filenames in the folder into an array
FileCount = FileCount + 1
DoEvents
End If
Else
MsgBox "Can't show more than 1000 files in one folder"
End If
Next
TotalFiles.Caption = FileCount
End Sub
Sub Timer1_OnTimer()
'5 second timer to show slides
If FilePosn<1000 then FilePosn=FilePosn+1
Set Image1.Picture = LoadPicture(FileCollection(FilePosn)
)
End Sub
'other controls are used to stop & start sequence, vary time and select the folder to show.
The Image control is within a frame so I can adjust the cropping for the wide screen TV.