|
-
Nov 15th, 2005, 10:16 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Shouldn't WebBrowser1_DocumentComplete happen only once?
Hi, I have a program that displays a popup message when the webbrowser control finishes loading a page. The problem is I get between 3-5 messages as the page loads, like its loading 5 pages.
I use the procedure for "WebBrowser1_DocumentComplete" so I figured once the entire page is done, this will run but it runs multiple times. Is there anyway to limit this to runs once at the end of the page download? the popup is displaying information it reads from the page and the first 1-2 messages are blank becuase the page hasnt loaded that far yet. any help?
-
Nov 15th, 2005, 10:35 AM
#2
Re: Shouldn't WebBrowser1_DocumentComplete happen only once?
no actually it can trigger many times... (for example..For each frame..)
to check for it to be completely loaded do this:
VB Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
[B]If (pDisp is Webbrowser1.Application) Then[/B]
'do code here
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Nov 15th, 2005, 10:51 AM
#3
Thread Starter
Fanatic Member
Re: Shouldn't WebBrowser1_DocumentComplete happen only once?
Thanks static, you come through again in a pinch
-
Nov 15th, 2005, 12:06 PM
#4
Thread Starter
Fanatic Member
Re: [RESOLVED] Shouldn't WebBrowser1_DocumentComplete happen only once?
A little side question, I am sure you probably can answer it static. Sometimes weather.com gives errors, the runtime ones that ask if you want to debug. Is there anyway to stop these types of errors? Actually all messages? I got the popups stopped using the NewWindow2 sub.
The reason I ask is that the form is hidden and once and a while this message might popup when the program reloads the webpage to get the newest temperatures.
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
|