-
WebBrowser Events
At the top of almost all the pages in VBForums.com, there are links for internet.com. When the mouse is hovered over some of these links like IT, Developer, News etc., a drop-down menu pops-up.
When I open a VBForums page in a browser which I have created using the WebBrowser control & hover the mouse over any of these links, the drop-down menu pops-up....that's fine but strangely the DownloadBegin & DownloadComplete events of the WebBrowser control also fire each time the mouse is moved over such links!
Now why are these 2 events firing when the mouse is moved over such links?
As it is, on most occasions, the DocumentComplete event fires more than once; that's the reason I thought of making use of the DownloadComplete event but this event behaves insanely!
-
Re: WebBrowser Events
I've been playing with WebBrowser as a result of another thread, you may find it interesting: http://www.vbforums.com/showthread.php?t=504545 as far as the DocumentComplete event is concerned. As to the DownLoadBegin and Complete activity, I don't see that happening.
-
Re: WebBrowser Events
You mean you don't see the DownloadBegin & DownloadComplete events firing more than once? If yes, have you tried navigating to this forum using the WebBrowser control?
If a web page loads very fast (like www.google.com), then these 2 events fire only once but if a web page takes some time to download, then these 2 events fire multiple times.
-
Re: WebBrowser Events
No, I don't see those events triggering when I hover the mouse over the Internet.com menu items.
When navigating to the home page of this site using http://www.vbforums.com/ two http requests are actually generated so there will be two DownLoadBegin and DownLoadComplete events. (Plus 2 of most of the other events associated with navigation)
The code I posted in the thread referenced earlier uses the WebBrowser control to demonstrate - perhaps you could try it and see.
-
Re: WebBrowser Events
You are very much correct that it makes 2 HTPPP requests but how did you come to the conclusion that it sends 2 HTTP requests?
-
Re: WebBrowser Events
Past experience with writing 'screen-scraping' applications and having long nights wondering why sometimes the DocumentComplete event seemed to trigger to early. I still haven't found a 100% reliable method of determining when the Document requested is loaded properly.
Using in-line Error Handling is probably the easiest circumvention, check if an Error of "Object Variable with Block Variable Not Set" is returned, if it is then go round a loop until it isn't, if there isn't an error then you know the Document is ready.
Whenever I start out on these types of Applications I usually go through the process of 'debug.print'ing the output from the Navigation events for the particular pages I'm interested in (as per that code I posted in the other thread) so I have a reasonable idea of what I'm up against.