473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

WebBrowser not catching popup windows

Hi,
I have a question regarding the catching of popups in a separate window. I
just can't get it to work. My browser is extremely simple and is designed
for a single purpose: to open a 'netlet' to a particular VPN on the United
Airlines network. The trouble is, I can't get my app to catch the popup
(which is the netlet). The netlet opens outside in a separate IE window
instead. I have a VB6 app that does what I want perfectly fine with
virtually exactly the same code (modified syntax of course ;). I'd like to
know what my code is not doing that it should be, and why it isn't catching
the popup window. Thanks!

below is the relevant code
note: code may wrap

private void fNetlet_Load(object sender, System.EventArgs e) {
if(!common.DEBUG_BROWSER) {
Browser.Silent = true;
Netlet.Silent = true;
}
Browser.RegisterAsBrowser = true;
Netlet.RegisterAsBrowser = true;
this.Visible = false;
this.Hide();
}

private void fNetlet_Closing(object sender, CancelEventArgs e) {
this.Hide();
}

private void fNetlet_Resize(object sender, EventArgs e) {
Browser.Width = this.Width - 4;
Browser.Height = this.Height / 2 - 4;
Netlet.Top = Browser.Bottom - 4;
Netlet.Width = this.Width - 4;
Netlet.Height = Browser.Height - 4;
}

private void Browser_NewWindow2(object sender,
AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) {
e.ppDisp = Netlet.Application;
Browser.Stop();
}

public void navigate(string url) {
object dummy = null;
object u = (object)url;
Browser.Navigate2(ref u, ref dummy, ref dummy, ref dummy, ref dummy);
}

Nov 15 '05 #1
1 7818
post some code
"Chris LaJoie" <ch***@etriptrader.com> wrote in message
news:OU**************@tk2msftngp13.phx.gbl...
Hi,
I have a question regarding the catching of popups in a separate window. I just can't get it to work. My browser is extremely simple and is designed
for a single purpose: to open a 'netlet' to a particular VPN on the United
Airlines network. The trouble is, I can't get my app to catch the popup
(which is the netlet). The netlet opens outside in a separate IE window
instead. I have a VB6 app that does what I want perfectly fine with
virtually exactly the same code (modified syntax of course ;). I'd like to know what my code is not doing that it should be, and why it isn't catching the popup window. Thanks!

below is the relevant code
note: code may wrap

private void fNetlet_Load(object sender, System.EventArgs e) {
if(!common.DEBUG_BROWSER) {
Browser.Silent = true;
Netlet.Silent = true;
}
Browser.RegisterAsBrowser = true;
Netlet.RegisterAsBrowser = true;
this.Visible = false;
this.Hide();
}

private void fNetlet_Closing(object sender, CancelEventArgs e) {
this.Hide();
}

private void fNetlet_Resize(object sender, EventArgs e) {
Browser.Width = this.Width - 4;
Browser.Height = this.Height / 2 - 4;
Netlet.Top = Browser.Bottom - 4;
Netlet.Width = this.Width - 4;
Netlet.Height = Browser.Height - 4;
}

private void Browser_NewWindow2(object sender,
AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) {
e.ppDisp = Netlet.Application;
Browser.Stop();
}

public void navigate(string url) {
object dummy = null;
object u = (object)url;
Browser.Navigate2(ref u, ref dummy, ref dummy, ref dummy, ref dummy);
}

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
5
by: Ian Stiles | last post by:
I have tried everything under the sun to get rid of horrible flashing and flickering that occurs on a CSharp form when the form hosts a TreeView or WebBrowser control and then you resize the form....
1
by: L. Chernov | last post by:
Hello, I am trying to work with .Net 2005 WebBrowser object, and put it on a "Windows control library" (embedded in a user control class) and then I am executing it from an ASP.Net webform(with...
0
by: Sin Jeong-hun | last post by:
I've found that if a MessageBox (called by alert/confirm from Javascript) or a web page modeless dialog is popped up, I cannot call Navigate of the WebBrowser control. If I do, a COM exception...
0
by: mike11d11 | last post by:
I have a tab control on my form that has a webbrowser docked in it. It automatically navigates to a website. Once the users clicks on a particular link and popup window should come up with a...
2
by: Jeroen | last post by:
We are experiencing a tuff-to-debug problem ever since we introduced a WebBrowser control into our failry large application. I'm not sure if the problem description below contains enough details,...
0
by: Andre Rode | last post by:
Hi, does somebody know how to redirect a popup fired by a webbrowser element to a second webbrowser? Background: I use a vb.net program to fill data into a website. At the end, all this is...
3
by: Dom | last post by:
I have a prgram with a webBrowser control. The user can click on a Linked Reference and the webBrowser control shows that site. Sometimes the URL (not my program, but the URL I am browsing to)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.