andyb7901
asked on
VB.Net Progress Bar
Hey,
Can someone tell me how I can use the progress bar thingy? I have a search that runs that takes a while. While this is running is it possible to have the progress bar ticking over?
Thanks
Can someone tell me how I can use the progress bar thingy? I have a search that runs that takes a while. While this is running is it possible to have the progress bar ticking over?
Thanks
ASKER
How would I make it run though? I have the following code to do a search. While the search ir running i would like the progress bar to run as well? Can this be done?
Private Sub SearchForFiles(ByVal StartDir As String)
Dim DirPath As String = Path.GetDirectoryName(Star tDir)
Dim FilePattern As String = Path.GetFileName(StartDir)
FilePattern = "*" & FilePattern & "*"
Dim TotalFiles As Integer = 0
lstResults.Items.Clear()
If Directory.Exists(DirPath) Then
Dim di As New DirectoryInfo(DirPath)
Dim fi() As FileInfo = di.GetFiles(FilePattern, SearchOption.AllDirectorie s)
For Each f As FileInfo In fi
lstResults.Items.Add(f.Ful lName)
TotalFiles += 1
Next
Else
lstResults.Items.Add("Inva lid Start Directory")
End If
lstResults.Items.Add("Tota l Files = " & TotalFiles.ToString())
End Sub
Private Sub SearchForFiles(ByVal StartDir As String)
Dim DirPath As String = Path.GetDirectoryName(Star
Dim FilePattern As String = Path.GetFileName(StartDir)
FilePattern = "*" & FilePattern & "*"
Dim TotalFiles As Integer = 0
lstResults.Items.Clear()
If Directory.Exists(DirPath) Then
Dim di As New DirectoryInfo(DirPath)
Dim fi() As FileInfo = di.GetFiles(FilePattern, SearchOption.AllDirectorie
For Each f As FileInfo In fi
lstResults.Items.Add(f.Ful
TotalFiles += 1
Next
Else
lstResults.Items.Add("Inva
End If
lstResults.Items.Add("Tota
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Im sorry to screw you around my code has changed? Could you tell me how to do it for my new code? Or shall I open a new question?
I think you should open another question, but anyway what happened to your code??????
ProgressBar1.Style = ProgressBarStyle.Marquee
ProgressBar1.MarqueeAnimat