Results 1 to 6 of 6

Thread: Status Bar w/ progress bar

  1. #1

    Thread Starter
    Member Cahlel's Avatar
    Join Date
    Aug 2000
    Location
    Earth (I think)
    Posts
    63

    Question

    ok, I want an internet status bar and this is my code:

    Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
    ProgressBar1.Max = ProgressMax
    ProgressBar1.Value = Progress
    End Sub

    now, when I run it, when the bar get's to the end, it give me an error that says:
    run-time error 380
    invalid proptery value

    What am I doing wrong?
    Wisdom is supreme, therefore get wisdom,
    though it costs all you have, get understanding.
    Proverbs 4:7

  2. #2
    Junior Member
    Join Date
    Apr 2000
    Posts
    27
    mabey Progress is an higher value then ProgressMax?
    Life's hard, but the front of a train is harder

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    Try This:
    Code:
    Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
        If ProgressMax >= Progress Then
            ProgressBar1.Max = ProgressMax 
            ProgressBar1.Value = Progress 
        End if
    End Sub
    Post #509

  4. #4
    Guest

    Talking Just an idea that i picked up somewhere. :)

    Use a ->

    Code:
    On error resume next
    Statement.


  5. #5
    Guest
    Kayoca is correct. The reason you get an error is because the Progressbar cannot go above a certain number. The Progress for the Webbrowser reads in thosands and can reach a million.

    Code:
    Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
    Label1.Caption = "Reading - " & Progress & " of " & ProgressMax & " bytes"
    End Sub
    
    Or using a Progressbar:
    
    Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
    On Error Resume Next
    Progressbar1.Min = 0
    Progressbar1.Max = ProgressMax
    Progressbar1.Value = Progress
    End Sub

  6. #6

    Thread Starter
    Member Cahlel's Avatar
    Join Date
    Aug 2000
    Location
    Earth (I think)
    Posts
    63

    Thumbs up Thank you

    Thank you all so much, you saved my butt.
    Wisdom is supreme, therefore get wisdom,
    though it costs all you have, get understanding.
    Proverbs 4:7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width