Hello there guys, The progress fine works partialy, but the debuger finds an error...
This is the error:
progressBar1.Value = (int)e.CurrentProgress;
Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value
This is the code:
[CODE]
private void webBrowser1_Progress(object sender, WebBrowserProgressChangedEventArgs e)
progressBar1.Maximum = (int)e.MaximumProgress;
progressBar1.Value = (int)e.CurrentProgress;
[/CODE]
Also I tried this:
[CODE]
progressBar1.Maximum = Convert.Toint32(e.MaximumProgress);
progressBar1.Value = Convert.Toint32(e.CurrentProgress);
[/CODE]
Any ideas??
Thank you !

Sam HobbsRank #107 · 20.5K reputationPosted Dec 26, 2010, 5:32 PM EST
thiago costaRank #6,113 · 276 reputationPosted Dec 26, 2010, 6:10 PM EST
So... what does that mean? ...
I don't know what to do...
well... that whole thing brings zero errors...
BUT, when i click on debug, as soon as the website loads, the debugger points to it and gives me an error, which is the one I wrote before...
This error is what it says:
Suthish NairRank #92 · 22.8K reputationPosted Dec 26, 2010, 10:11 PM EST
thiago costaRank #6,113 · 276 reputationPosted Dec 27, 2010, 8:15 AM EST
I am not a pro like you guys yet...
so...
Suthish, how would I do what you sugested? can I have a hint?
Thanks bro!
Suthish NairRank #92 · 22.8K reputationPosted Dec 27, 2010, 10:51 AM EST
Also, i didnt worked on progree bar.
There is Maximum and Minimum property value for Progress Bar. Please check or wait for more replys from others.
Sam HobbsRank #107 · 20.5K reputationPosted Dec 27, 2010, 10:55 AM EST
Working with ProgressBar in C#
C# ProgressBar
ProgressBar Class (System.Windows.Forms)
thiago costaRank #6,113 · 276 reputationPosted Dec 27, 2010, 1:55 PM EST
I have attached project.zip above.
You guys can check the error if you want. I will give you guys the source..
the name of the program is Self Update:
There are 4 functions:
1) Download Latest Version of c# Generator (an open source software I started)
2) Launch C# Generator (will launch the exe of it.
3) Download Latest Sourcecode (will download latest version of the sourcecode (for the c# generator I am working on)
And finally:
4) Launch Main Thread
This is where I am having the trouble.. if you click on launch main thread, the webbrowser I am working on will open...
There is a progress bar INSIDE the webbrowser... that is the progress bar I am having trouble with...
I put a IF ELSE line there, but that is jst to try to resolve this issue... But it didn't work...
I compiled it with Visual Studio 2010... I hope you guys can help me by looking at my source code.
Thank you. Also, please ignore the progress bar in the Self Update window. That is a totaly different one.
Also... How do I change my profile picture?
This solved my problem :D
private void webBrowser1_Progress(object sender, WebBrowserProgressChangedEventArgs e) { if (e.CurrentProgress == 0 || e.CurrentProgress == 90000000) { //progressBar1.Value = 90000000; progressBar1.Value = 0; progressBar1.Value = (int)e.CurrentProgress; progressBar1.Value = 90000000; } else { return; }