There is a progress bar control, the problem is you must be able to
determine when a step is complete so you can update the progress bar
with the current percentage. I don't know of any "magic" control that
can automatically track a process's completion.
Thanks,
Seth Rowe [MVP]
I also wonder an efficent way to get percentage of the process that is
done. In my opinion, progress bar is widely used with an helper
process which provides the current work's progress situation with
numerical percantage such between %0-%100. I mean;
Progressbar1.value = process.progressValue
If you don't know the exact percantage but you know how much it'll
take with a reasonable guess, you can step forward the progress bar
value by your own. In this case using timer is good for pushing value
forward automatically:
See this:
'Assume that your work will take 10 seconds
'Use a timer control for automatic increment.
'Don't forget to set timer's interval to 1000miliseconds
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
' To avoid not to move further than 100
If Not ProgressBar1.Value = 100 Then
ProgressBar1.Value = ProgressBar1.Value + 10
End If
If ProgressBar1.Value = 100 Then
' Disable timer when work is finished
Timer1.Enabled = False
'Work has been done
MsgBox("Work has been done")
End If
End Sub
In this code, progress bar will step forward with 10 block increments
and 1 second interval which will take absolute 10 secons at total.
But i know this is completely not reliable and not the aim, because
noone can know the that how long the same work will take, so as i
stated previously, it depends on your process's progress providing
capability.
Hope this helps.