G
Gabe Matteson
I am trying to set the maximum value of the progress bar so that when a user
searches through the specified directory they can see their status. the
progress bar name is on form2 and is named progstatus. Does anyone know how
to set this up with the code below? appreciate it. thank you.
Private Function Dir(ByVal sDir As String)
Try
Dim strDir As String
Windows.Forms.Cursor.Current = Cursors.WaitCursor
For Each strDir In System.IO.Directory.GetDirectories(sDir)
If blnClosed = True Then
Return intDirCount
Exit Function
End If
Dir(strDir)
intDirCount = intDirCount + 1
Next
Return intDirCount
Windows.Forms.Cursor.Current = Cursors.Arrow
Catch ex As Exception
Return intDirCount
Windows.Forms.Cursor.Current = Cursors.Arrow
MsgBox(ex, MsgBoxStyle.Information, "Exception")
End Try
End Function
Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnQuery.Click
intDirCount = 0
Dim strResults As String = Dir(Trim(LCase(txtDirSource.Text)))
MsgBox("Number of Directories: " & strResults, MsgBoxStyle.Information,
"Query Statistics")
End Sub
searches through the specified directory they can see their status. the
progress bar name is on form2 and is named progstatus. Does anyone know how
to set this up with the code below? appreciate it. thank you.
Private Function Dir(ByVal sDir As String)
Try
Dim strDir As String
Windows.Forms.Cursor.Current = Cursors.WaitCursor
For Each strDir In System.IO.Directory.GetDirectories(sDir)
If blnClosed = True Then
Return intDirCount
Exit Function
End If
Dir(strDir)
intDirCount = intDirCount + 1
Next
Return intDirCount
Windows.Forms.Cursor.Current = Cursors.Arrow
Catch ex As Exception
Return intDirCount
Windows.Forms.Cursor.Current = Cursors.Arrow
MsgBox(ex, MsgBoxStyle.Information, "Exception")
End Try
End Function
Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnQuery.Click
intDirCount = 0
Dim strResults As String = Dir(Trim(LCase(txtDirSource.Text)))
MsgBox("Number of Directories: " & strResults, MsgBoxStyle.Information,
"Query Statistics")
End Sub