Me.ProgressBar1.Minimum = 0
Me.ProgressBar1.Maximum = 100
Dim Counter As Integer = 0
Dim p As Process = Process.Start("Notepad.exe")
Do Until p.WaitForInputIdle()
If Counter >= 100 Then
Counter = 0
End If
Me.ProgressBar1.Value = Counter
Counter += 1
Loop
Me.ProgressBar1.Value = 100
the above code will cycle through 0 to 99 and single step the progress bar until the started app is idle....
The is a caveat with using "waitForIdleInput" see the following....
Return Value
true if the associated process has reached an idle state; otherwise, false.
Remarks
|