Results 1 to 11 of 11

Thread: Loading Bar - Web Browser [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Resolved Loading Bar - Web Browser [RESOLVED]

    Hi Again Everyone

    I have made a standard webbrowser and at the bottom of the form i am wanting to put a progress bar so the user knows how long the page is going to take to load but as some pages are going to take longer than others so a standard timer wont do it

    Any help on the matter would be appreciated
    Last edited by Aaron Smith; May 19th, 2005 at 10:44 AM.
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Loading Bar - Web Browser

    This has a progress control in it.
    Attached Files Attached Files

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Loading Bar - Web Browser

    Quote Originally Posted by dglienna
    This has a progress control in it.
    Thank you for trying to send this but i am using an internet connection which is a shared internet connection and the administrator has set the security settings to deny all incoming files

    If you could possible take the file and print the code which would be required for the progress bar.

    Thanks
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Loading Bar - Web Browser

    Use the ProgressChange event.

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Loading Bar - Web Browser

    Add the progress bar:

    in the Webbrowser event Progress
    VB Code:
    1. Private Sub Command1_Click()
    2. WebBrowser1.Navigate "http://www.vbforums.com"
    3. End Sub
    4.  
    5. Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
    6. On Error Resume Next
    7. ProgressBar1.Max = ProgressMax
    8. ProgressBar1.Value = Progress
    9. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Loading Bar - Web Browser

    Quote Originally Posted by penagate
    Use the ProgressChange event.
    Thank you penagate for telling me the property i have to change

    and thank you [LGS]Static for your help with the code

    The program now works the way i want it too
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  7. #7
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Loading Bar - Web Browser

    Please notice that the ProgressChange event works very unreliable. That code snippet was the only way I could more or less get it to work. The MSDN documentation doesn't list any bugs or problematic behavior, but the parameters sometimes have very strange values. Sometimes the ProgressMax parameter is even higher than the Progress parameter... That's why the error handler is added to the code.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Loading Bar - Web Browser

    Quote Originally Posted by TheVader
    Please notice that the ProgressChange event works very unreliable. That code snippet was the only way I could more or less get it to work. The MSDN documentation doesn't list any bugs or problematic behavior, but the parameters sometimes have very strange values. Sometimes the ProgressMax parameter is even higher than the Progress parameter... That's why the error handler is added to the code.
    I think you mean Progress is higher than ProgressMax
    Who knows why.

  9. #9
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Loading Bar - Web Browser

    Quote Originally Posted by penagate
    I think you mean Progress is higher than ProgressMax
    The other way around wouldn't be so noteworthy...

    By the way, here are the results of ProgressChange when navigating to vbforums.com. The first values look fairly accurate, but in the end it becomes strange...
    Code:
    Progress Max
    0	10000
    50	10000
    10500	1000000
    21200	1000000
    31800	1000000
    43000	1000000
    61100	1000000
    71900	1000000
    84700	1000000
    105900	1000000
    121400	1000000
    158800	1000000
    171300	1000000
    247700	1000000
    279400	1000000
    290800	1000000
    304500	1000000
    321300	1000000
    342500	1000000
    355300	1000000
    370200	1000000
    387900	1000000
    409700	1000000
    452100	1000000
    510500	1000000
    607900	1000000
    607900	10000
    10000	10000
    -1	10000
    0	0
    1000000	1000000
    1000000	1000000
    -1	1000000
    1000000	1000000
    0	0
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  10. #10
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Loading Bar - Web Browser

    yeah, here's what I got, pretty much the same:
    Code:
    Prog	ProgMax
    100     10000
    100     10000
    150     10000
    200     10000
    250     10000
    300     10000
    350     10000
    41800   1000000
    52200   1000000
    64300   1000000
    75000   1000000
    85000   1000000
    97600   1000000
    112600  1000000
    124000  1000000
    137000  1000000
    151300  1000000
    166900  1000000
    185300  1000000
    205300  1000000
    216400  1000000
    228300  1000000
    241100  1000000
    254800  1000000
    269600  1000000
    285600  1000000
    303800  1000000
    322100  1000000
    344100  1000000
    366600  1000000
    392800  1000000
    422700  1000000
    457600  1000000
    467900  1000000
    704000  1000000
    704000  10000
    704050  10000
    766800  10000
    807900  10000
    1340400 10000
    1704000 10000
    1704000 10000
    1704050 10000
    1704100 10000
    10000   10000
    -1      10000
    0       0
    Except mine goes retarded a bit earlier. It is really strange.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Loading Bar - Web Browser

    Thank you verytone for taking an interst to my post

    And thank you for your help

    Thanks
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

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