WebBrowser's Document Complete event
-
When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."
-
When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."
Are you trying to detect when the page has loaded? try the body.onload event, but be aware that this will only fire when all of the content has downloaded (images etc.). You could also put a call to your function in tags at the bottom of the page if you want it to fire when the html is downloaded. Find my .Net blog at <a href="http://hiltong.blogspot.com">http://hiltong.blogspot.com</a></x-turndown>
-
When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."
It fires because the page your loading supports frames. The event will fire when the frame page is done loading (usually the one your navigated to), and it also fires for each subpage that the frame page loads. This behavior is by design. You can't turn it off. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Are you trying to detect when the page has loaded? try the body.onload event, but be aware that this will only fire when all of the content has downloaded (images etc.). You could also put a call to your function in tags at the bottom of the page if you want it to fire when the html is downloaded. Find my .Net blog at <a href="http://hiltong.blogspot.com">http://hiltong.blogspot.com</a></x-turndown>
body.onload is not exposed via the mshtml interface. I have an AxWebBrowser component inside my Windows Forms project. That's where the event is hooked. Sammy "A good friend, is like a good book: the inside is better than the cover..."