954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Progress bar in web browser

For the life of me, I can't get this to work.... What am I doing wrong?
Any help is greatly appreciated!!

Private Sub webBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
        On Error Resume Next
        If Progress = -1 Then ProgressBar1.Value = 100
        lbl1.Text = "Done"
        ProgressBar1.Visible = False
        If Progress > 0 And ProgressMax > 0 Then
            ProgressBar1.Visible = True
            ProgressBar1.Value = Progress * 100 / ProgressMax
            lbl1.Text = Int(Progress * 100 / ProgressMax) & "%"
        End If

    End Sub
FutureDev86
Newbie Poster
6 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Whats the error you received?

Netcode
Veteran Poster
1,021 posts since Jun 2009
Reputation Points: 43
Solved Threads: 67
 

Does "lbl1" refer to a Label control on a form? If so, you should be setting "lbl1.Caption" instead of "lbl1.Text" equal to your value.

If this is not the case, we need more information about your application before we can provide guidance.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

I'm not getting any error messages. The progress bar is displaying, but it's not showing any increments. I changed lbl1 to lbl1.Caption and it's giving me the error message, "'Caption' is not a member of 'System.Windows.Forms.Label'"

FutureDev86
Newbie Poster
6 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Is this .Net? And Windows Forms? Okay, forget about the lbl1.Caption thing. That's only for VB6 controls.

I'm not really a .Net guy, but I do know that you can't just set the values and have the progress bar magically increment itself. You have to set the progress bar maximum and minimum values, then use the PerformStep method to advance the progress bar. Here's a link to more information about using the Windows Forms Progress Bar PerformStep method.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You