Results 1 to 2 of 2

Thread: Display Scrolling Files and Folders

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Display Scrolling Files and Folders

    Display Scrolling Files and Folders

    I would like to use a label to display a scrolling list of all of the files and folders on a computer, something like when you copy a file.

    C:\folder1\folder2\file1
    C:\folder1\folder2\file2
    C:\folder2\folder2\file1
    C:\folder2\folder2\file2…….

    These would be displayed one at a time, I would also like them to be displayed by the size of the file also? Something like?

    32mb *.001 seconds
    128mb*.001 seconds

    Any Ideas

    Thanks

    Art
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Display Scrolling Files and Folders

    VB Code:
    1. Private Type FileData
    2.     FilePath As String
    3.     FileSize As Long
    4. End Type
    5.  
    6. Dim FileInfo() As FileData
    7. Dim Num As Long
    8. Dim PrevTime As Long
    9.  
    10. Private Sub Form_Load()
    11.     ReDim FileInfo(3)
    12.    
    13.     'Filelen gets size in b so u may have to change it to get in Mb
    14.    
    15.     FileInfo(0).FilePath = "C:\folder1\folder2\file1"
    16.     FileInfo(0).FileSize = FileLen(FileInfo(0).FilePath)
    17.    
    18.     FileInfo(1).FilePath = "C:\folder1\folder2\file2"
    19.     FileInfo(1).FileSize = FileLen(FileInfo(1).FilePath)
    20.    
    21.     FileInfo(2).FilePath = "C:\folder2\folder2\file1"
    22.     FileInfo(2).FileSize = FileLen(FileInfo(2).FilePath)
    23.    
    24.     FileInfo(3).FilePath = "C:\folder2\folder2\file2"
    25.     FileInfo(3).FileSize = FileLen(FileInfo(3).FilePath)
    26.    
    27.     Timer.Interval = 10     '0.01 sec
    28. End Sub
    29.  
    30. Private Sub Timer_Timer()
    31. PrevTime = PrevTime + 1
    32.  
    33. tempnum = Num - 1
    34. If tempnum < 0 Then tempnum = UBound(FileInfo)
    35.  
    36. If PrevTime <= FileInfo(tempnum).FileSize Then Exit Sub
    37. PrevTime = 0
    38.  
    39. lblDisplay.Caption = FileInfo(Num).FilePath
    40.  
    41. Num = Num + 1
    42. If Num > UBound(FileInfo) Then Num = 0
    43. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width