Add a progresbar to your web browser


Ok, first add a progressbar. you may have to go to components and select "Microsoft windows common controls 6.0" Make a label also. also add a picturebox.

now add this code:
VISUALBASIC Code
  1. Private Sub webbrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
  2. On Error Resume Next
  3. If Progress = -1 Then ProgressBar1.Value = 100
  4. Label1.Caption = "Done"
  5. ProgressBar1.Visible = False
  6. Image1.Visible = True
  7. If Progress > 0 And ProgressMax > 0 Then
  8. ProgressBar1.Visible = True
  9. Image1.Visible = False
  10. ProgressBar1.Value = Progress * 100 / ProgressMax
  11. Label2.Caption = Int(Progress * 100 / ProgressMax) & "%"
  12. End If
  13. Exit Sub
  14. End Sub


Now you have a progressbar!

now if you want it to scroll with the browser at the bottum, i added this code (mine were at the bottum left):
VISUALBASIC Code
  1. Private Sub Timer2_Timer()
  2. ProgressBar1.Top = Form1.ScaleHeight - 255
  3. Label1.Top = Form1.ScaleHeight - 255
  4. End Sub

1st you must make a timer called timer2, enable it, and give it a low interval from about 1-100.

Note: you may have to replace "255" according to your program.
zar's Avatar
Author:
Views:
2,568
Rating:
Posted on Saturday 29th December 2007 at 01:40 PM
Dalez
Dalez's Avatar
It doesn't work :(
Posted on Tuesday 4th December 2007 at 05:28 PM
Dean
Dean's Avatar
yeh this is stolen ive seenon another website also
Posted on Monday 3rd December 2007 at 09:58 PM
zar
zar's Avatar
LIES! :)

actually i looked at like 3 tutorials on this and fixed it up better.
Posted on Monday 3rd December 2007 at 04:16 PM
darklight19
darklight19's Avatar
This code was stolen, I've seen it somewhere...