|
-
Apr 17th, 2006, 01:14 PM
#1
Thread Starter
Fanatic Member
VS 2005 WebBrowser?
Hello,
Does anybody know a quick way to add the status bar to the bottom of the WebBrowser control? This would show status as the user loads another page.
Thanks,
Christian
In life you can be sure of only two things... death and taxes. I'll take death.
-
Apr 17th, 2006, 01:40 PM
#2
Re: VS 2005 WebBrowser?
Just add the web browser to you form, add a status bar to your form, add a panel to the status bar and write a line of code in the proper event of the web browser that shows the load time. It doesn't get much quicker than that.
-
Apr 17th, 2006, 01:42 PM
#3
Re: VS 2005 WebBrowser?
to my knowledge there is no way to implement the IE status bar into your application.
You could implement your own status bar, and mimic IE's for the most part.. using properties like StatusText and the StatusTextChanged event, and the IsBusy property, etc...
-
Apr 17th, 2006, 08:22 PM
#4
Re: VS 2005 WebBrowser?
Normally you'd add a StatusStrip and add a progress bar to it. You can then use the events of the WebBrowser, specifically ProgressChanged, to set the progress. The 'e' argument in the ProgressChanged event handler has CurrentProgress and MaximumProgress properties that you can use to set the corresponding properties of the progress bar. Just note that that event can give odd values when the document starts loading and when it finishes. I can't remember the exact details but you'll have to finesse things a little to prevent exceptions at those points. Just use a bit of trial and error to work out the issues. I did exactly that to answer basically the same question for someone else when I'd never used the WebBrowser before. I added Debug.WriteLine calls to write the CurrentProgress and MaximumProgress values so I could see where it went weird and work out what special cases I needed to allow for.
-
May 27th, 2006, 09:25 AM
#5
New Member
Re: VS 2005 WebBrowser?
I was looking for an answer to the status bar problem myself, but have just discovered these two pages: they will do what you want:
http://www.planetsourcecode.com/vb/s...1819&lngWId=10
http://www.planetsourcecode.com/vb/s...1953&lngWId=10
Tim in Ireland
-
May 30th, 2006, 11:31 AM
#6
Thread Starter
Fanatic Member
Re: VS 2005 WebBrowser?
Thanks dude. The examples look very promising. :-)
In life you can be sure of only two things... death and taxes. I'll take death.
-
May 31st, 2006, 01:46 AM
#7
Re: VS 2005 WebBrowser?
VB Code:
Private Sub Webbowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles Webbrowser1.ProgressChanged
Progress1.Visible = True
If e.MaximumProgress <> 0 And e.MaximumProgress >= e.CurrentProgress Then
Progress1.Value = Convert.ToInt32(100 * e.CurrentProgress / e.MaximumProgress)
Else
With Progress1
.Value = 0
.Visible = False
End With
End If
End Sub
'Progress1 = name of the ProgressBar in the StatusBar.
-
May 31st, 2006, 11:17 AM
#8
Thread Starter
Fanatic Member
Re: VS 2005 WebBrowser?
Radjesh Klauke,
You totally rock. I don't know how I missed that event. Thank you so much!
--Christian
In life you can be sure of only two things... death and taxes. I'll take death.
-
Jun 2nd, 2006, 07:50 AM
#9
New Member
Re: VS 2005 WebBrowser?
that really helped me alot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|