Question How to use progress bars?

Haxaro

Well-known member
Joined
Mar 13, 2009
Messages
105
Programming Experience
1-3
How do i use progress Bars?

For example, i have three different situations where i need a progress bar.

1. In my Web Browser, i copied a code for a progress bar, that shows how much of the page has loaded etc, but how can i clear it when it has finished loading???

VB.NET:
 Private Sub webBrowser_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        If e.MaximumProgress <> 0 And _
           e.MaximumProgress >= e.CurrentProgress Then
            ProgressBar1.Value = Convert.ToInt32( _
              100 * e.CurrentProgress / e.MaximumProgress)
        End If
End Sub




2. How can i make a Progress Bar, that goes for a set amount of time, so if i wanted a progress bar to last for say, 10 seconds, what would the code for that be?


3. A progress bar that shows how muc of something has completed, such as Loading, Unpacking etc. How can i make a progress bar that goes up when something completes, such as a certain feature has loaded etc?


The main two questions are number 1, and 2, and i know that number 3 is poorly written, but i dont know how else to describe it, although it is not essential for the moment...

Thanks,
Haxaro
 
1. Help for CurrentProgress says -1 means download has completed. You set progressbar Value to 0 to clear it.
2. Time related progress is usually indetermined, there is a Style property you can set to Marquee that works for this. If time is determined you can use a Timer to raise events in intervals where you calculate progress in means of current/total percentage.
3. progressbar is controlled with Value property.
 
Back
Top