Webbrowser ProgressBar

Posts 1–14 of 14 · Page 1 of 1
Webbrowser ProgressBar
hello!
I am doing a browser in VB Studio and all I need is the code for progressbar to work.
Tried lots but none work. Can anyone give me a code or a link to a thread with the code, if it exists already?

Thanks in advance!
Code:
    Private Sub Webbrowser_ProgressChanged(sender As Object, e As WebBrowserProgressChangedEventArgs) Handles Webbrowser.ProgressChanged
        ProgressBar.Maximum = e.MaximumProgress
        ProgressBar.Value = e.CurrentProgress
    End Sub
Thank you Blubb1337, it works, but it gives me an error after I press f5 to test it:

Code:
Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value
Quote Originally Posted by Mokou-Sama View Post
Thank you Blubb1337, it works, but it gives me an error after I press f5 to test it:

Code:
Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value
I don't fully remember what I did to "solve" this.
But I added the code in a try/catch statement.
Try that and see what you get. Or just play around with the values...
Blubb1337's code worked for me. Maybe you misspelled something in previous coding ?
Quote Originally Posted by FallenDark View Post
Blubb1337's code worked for me. Maybe you misspelled something in previous coding ?
So did to me. Thing is, the "-1" error came out of nowhere and I'm having a hard time looking for the source of the problem.
Will investigate a bit more. Ill post here the results later.
Quote Originally Posted by Mokou-Sama View Post


So did to me. Thing is, the "-1" error came out of nowhere and I'm having a hard time looking for the source of the problem.
Will investigate a bit more. Ill post here the results later.
It's probably because some how, it's starting with -1... Dunno how, but to fix this use this -
Code:
ProgressBar1.Value = 0 'This is just to start it at 0% in case if it's trying to start at -1. you don't need it though.
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 100
pm me with the full code. Maybe i can help you
And no one saw my suggest about a Try/Catch statement?

Suppose I will just try it and see what happens...
Since no one respond as I seen....

And just tested and for now, it works like a god :P
(It seems to be a bit slow to start load, like it's 1 sec behind...)

Code:
Private Sub WebBrowser1_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        Try
            ProgressBar1.Maximum = e.MaximumProgress
            ProgressBar1.Value = e.CurrentProgress
        Catch ex As Exception

        End Try
    End Sub
Quote Originally Posted by Jorndel View Post
And no one saw my suggest about a Try/Catch statement?

Suppose I will just try it and see what happens...
Since no one respond as I seen....

And just tested and for now, it works like a god :P
(It seems to be a bit slow to start load, like it's 1 sec behind...)

Code:
Private Sub WebBrowser1_ProgressChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        Try
            ProgressBar1.Maximum = e.MaximumProgress
            ProgressBar1.Value = e.CurrentProgress
        Catch ex As Exception

        End Try
    End Sub


It works fine! Thanks!

IT WORKS!
Quote Originally Posted by Mokou-Sama View Post




It works fine! Thanks!

IT WORKS!
It would be solved then if you just had read by post

Well, happy it works and happy that you are

Quote Originally Posted by Jorndel View Post
It would be solved then if you just had read by post

Well, happy it works and happy that you are

Mine probably would have solved it too -_-
Quote Originally Posted by Cryptonic View Post


Mine probably would have solved it too -_-
Well, if I don't remember wrong.
The progress is given in FLOAT value.

And it would go up and down. (But that's in C#)

What I code.
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us