M626
Programmer
- Mar 13, 2002
- 299
I have a label bar that looks at all files in a folder and scrolls all the file names through a label. My problem is that when i add files it seems to skip every other or sometime s it only should 2 our of the 5 in the folder.
Here is my code if anyone can help me figure this one out.
Private Sub Timer1_Timer()
Static Count As Integer
Dim FS As New FileSystemObject
Dim FSfolder As Folder
Dim File As File
Dim i As Integer
Dim aryTemp() As String
Set FSfolder = FS.GetFolder(CurDir & "\Files")
For Each File In FSfolder.Files
DoEvents
aryTemp = Split(File, "\")
'######################
'When the label goes off the left side of the form,
' reposition it onto the right side.
If (lblMarquee.Left + lblMarquee.Width) <= 0 Then
lblMarquee.Left = Form1.Width
'lblMarquee = ""
lblMarquee = aryTemp(UBound(aryTemp))
Count = Count + 1
End If
lblMarquee.Left = lblMarquee.Left - 100
'########################
Next File
Set FSfolder = Nothing
End Sub
Here is my code if anyone can help me figure this one out.
Private Sub Timer1_Timer()
Static Count As Integer
Dim FS As New FileSystemObject
Dim FSfolder As Folder
Dim File As File
Dim i As Integer
Dim aryTemp() As String
Set FSfolder = FS.GetFolder(CurDir & "\Files")
For Each File In FSfolder.Files
DoEvents
aryTemp = Split(File, "\")
'######################
'When the label goes off the left side of the form,
' reposition it onto the right side.
If (lblMarquee.Left + lblMarquee.Width) <= 0 Then
lblMarquee.Left = Form1.Width
'lblMarquee = ""
lblMarquee = aryTemp(UBound(aryTemp))
Count = Count + 1
End If
lblMarquee.Left = lblMarquee.Left - 100
'########################
Next File
Set FSfolder = Nothing
End Sub