|
-
December 6th, 2010, 10:22 AM
#1
Progress bar Error!
I am running c# 2010/.NET 4 Client Profile
I have some code for my progress bar-statusProgress
this code seems to do it's job, it displays the progress of my web browser control-webBrowser
There is no error written, but when i load my app, it says:
Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value
Code is:
private void webBrowser_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
{
statusProgress.Maximum = Convert.ToInt32(e.MaximumProgress);
statusProgress.Value = Convert.ToInt32(e.CurrentProgress);
}
Please give some help!
-
December 6th, 2010, 11:33 AM
#2
Re: Progress bar Error!
from time to time you should take a look at msdn first ;]
WebBrowserProgressChangedEventArgs.CurrentProgress Property
Property Value
The number of bytes that have been loaded or -1 to indicate that the download has completed.
you have to handle this case properly
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback  you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
December 6th, 2010, 02:16 PM
#3
Re: Progress bar Error!
i've already done that
but it just has the same box- but with different values spawning indefinitely.
Can you give some code that can ensure that the progress bar doesn't make an error!
-
December 6th, 2010, 06:43 PM
#4
Re: Progress bar Error!
 Originally Posted by Jonathanwb
i've already done that
but it just has the same box- but with different values spawning indefinitely.
Can you give some code that can ensure that the progress bar doesn't make an error!
No, we can't. Your original error is due to a value of -1 being returned and you not accounting for that possibility in your code. If you have a new problem then you will need to describe it for us.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|