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:
Private Sub Command1_Click()
Dim i As Integer
ProgressBar1.min = 0
'ProgressBar1.Max = 100
ProgressBar1.Value = 0
ProgressBar1.Scrolling = ccScrollingSmooth
Dim strFile() As String, strPath As String
Dim n As Long, nCount As Long
On Error Resume Next
With CommonDialog1
CommonDialog1.Filter = "MP3 Files|*.mp3" 'Only Show MP3 type files in folder
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNLongNames
.CancelError = True
.InitDir = "C:\"
.DialogTitle = "Select File To Add To Playlist"
.ShowOpen
If Err.Number <> cdlCancel Then
strFile = Split(.FileName, vbNullChar)
nCount = UBound(strFile)
If nCount = 0 Then
'Only one file is selected so split up the path and the filename
ReDim strFile(1)
strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
nCount = 1
End If
strPath = strFile(0)
If Right$(strPath, 1) <> "\" Then
strPath = strPath & "\"
End If
ProgressBar1.Max = nCount
For n = 1 To nCount
If Len(Dir(FAVORITES_FOLDER & strFile(n))) = 0 Then
FileCopy strPath & strFile(n), FAVORITES_FOLDER & strFile(n)
End If
ProgressBar1.Value = nCount
Next
End If
End With
End Sub
any suggestions
Thanks
R