Results 1 to 11 of 11

Thread: progress bar glitch [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Resolved progress bar glitch [RESOLVED]

    Hi all,

    I have a progress bar that displays when files are bieng added to a folder but instead of the progress bar being displayed in a way that it goes up in squares it just seems to be there and doesnt display until the files are added.

    heres my code

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     Dim i As Integer
    4.  
    5.     ProgressBar1.min = 0
    6.     'ProgressBar1.Max = 100
    7.     ProgressBar1.Value = 0
    8.     ProgressBar1.Scrolling = ccScrollingSmooth
    9.  
    10.     Dim strFile() As String, strPath As String
    11.     Dim n As Long, nCount As Long
    12.     On Error Resume Next
    13.     With CommonDialog1
    14.         CommonDialog1.Filter = "MP3 Files|*.mp3"       'Only Show MP3 type files in folder
    15.  
    16.         .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNLongNames
    17.         .CancelError = True
    18.         .InitDir = "C:\"
    19.         .DialogTitle = "Select File To Add To Playlist"
    20.      
    21.         .ShowOpen
    22.         If Err.Number <> cdlCancel Then
    23.             strFile = Split(.FileName, vbNullChar)
    24.             nCount = UBound(strFile)
    25.             If nCount = 0 Then
    26.                 'Only one file is selected so split up the path and the filename
    27.                 ReDim strFile(1)
    28.                 strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
    29.                 strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
    30.                 nCount = 1
    31.             End If
    32.             strPath = strFile(0)
    33.             If Right$(strPath, 1) <> "\" Then
    34.                 strPath = strPath & "\"
    35.             End If
    36.             ProgressBar1.Max = nCount
    37.             For n = 1 To nCount
    38.                 If Len(Dir(FAVORITES_FOLDER & strFile(n))) = 0 Then
    39.                     FileCopy strPath & strFile(n), FAVORITES_FOLDER & strFile(n)
    40.                 End If
    41.                 ProgressBar1.Value = nCount
    42.             Next
    43.         End If
    44.     End With
    45. End Sub

    any suggestions
    Thanks
    R
    Last edited by robvr6; Mar 24th, 2005 at 07:38 PM.

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