|
-
Jul 15th, 2000, 11:03 AM
#1
Thread Starter
Addicted Member
I am using the WebBrowser control and would like to know how to avoid popup SCREENS. Or I kill them when they appear, or they doesn`t appear at all. Both would be fine
Any help?
-
Jul 15th, 2000, 11:10 AM
#2
This will make it so no popup windows will open.
Code:
Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
End Sub
This will open popup windows using your program and not IE.
Code:
Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim F As New Form1
Set ppDisp = F.webbrowser1.object
F.Show
End Sub
-
Jul 15th, 2000, 09:41 PM
#3
Fanatic Member
URL please.
Hi.
Does anyone know of a URL that produces a "Popup Window" when navigated to so that I can see Matthew's code in action?
Thanks.
-
Jul 15th, 2000, 10:23 PM
#4
http://www.aol.com has a popup window.
Or you could make your own and view it like Webbrowser1.Navigate "C:\popup.htm"
Code:
<SCRIPT LANGUAGE="JavaScript">
function popupwin(){
windowpopup=window.open("",'popup','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=1,width=420,height=420');
windowpopup.document.writeln("<head><title>Homepage</title></head><body bgcolor='black' text=white>");
windowpopup.document.writeln("<h2><center>Welcome to The Homepage!</h2>");
windowpopup.document.writeln('<h3><center>Check out some cool VB Sites:<BR></center></h3>');
windowpopup.document.writeln('<a href=http://www.vb-world.net/ target=new>');
windowpopup.document.writeln('VB-World.net');
windowpopup.document.writeln('</a><BR>');
windowpopup.document.writeln('<a href=http://www.vbcode.com/ target=new>');
windowpopup.document.writeln('Vbcode.com');
windowpopup.document.writeln('</a><BR>');
</SCRIPT>
<html>
<body onLoad="popupwin()">
</html>
[Edited by Matthew Gates on 07-15-2000 at 11:36 PM]
-
Jul 16th, 2000, 07:32 AM
#5
Fanatic Member
Matthew, follow-up please.
Hi.
Matthew I used the code you posted:
Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
End Sub
It worked, but it also caused something weird to happen. Now, when I navigate to http://www.aol.com using Internet Explorer, no pop-up window comes up. Even if I navigate to it using the webbrowser control, without putting in the above code, no pop-up window comes up. Can you, or anyone else interested, look into this and tell me what you think?
Thanks.
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
|