Jump to content

Help with progress bar?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
eliasmaq

eliasmaq

    Newbie

  • Members
  • Pip
  • 9 posts
Let me explain, im making a webbrowser with tabs, and i added a statusstrip, and on it i added a progressbar that follows this code:
progressBar.Maximum = Convert.ToInt32(e.MaximumProgress);

progressBar.Value = Convert.ToInt32(e.CurrentProgress);
and everything goes fine until the loading reaches the end, then my debugging stops and the vb says
"value cannot be -1"
i dont know what is wrong???!!!!!

#2
Grimling

Grimling

    Newbie

  • Members
  • PipPip
  • 13 posts
Can you give some more context? I'd like to know what type "e" is, before I can help you.
Floris

#3
thanasis2028

thanasis2028

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
This is a problem of webbrowser. When the page fully loads e.currentprogress becomes -1. So change the code to this:
If Convert.ToInt32(e.CurrentProgress)>0 Then[FONT=monospace]
[/FONT]   progressBar.Maximum = Convert.ToInt32(e.MaximumProgress);[FONT=monospace]
[/FONT]   progressBar.Value = Convert.ToInt32(e.CurrentProgress);
End If
And this is VB not C++. Why are you using semicolons?
My software company:Porosis Software
Games: Terrantula
Apps: Mathanasis, ColorGrabber (New!)