Question Web Browser New Window In Tab Control WebBrowserNewWindow Error

aaronmchale

New member
Joined
Dec 12, 2011
Messages
4
Programming Experience
3-5
I am making a web browser for a Kiosk system that uses a tab control to display web pages, the user can add and remove tabs. When a new tab is created it creates a new web browser using:

Dim newbrowser As New WebBrowser

In the AddWebTab private sub, which is called when the users adds a tab.
I have also added some handlers:

AddHandler newbrowser.DocumentCompleted, AddressOf browserloadedAddHandler newbrowser.NewWindow, AddressOf WebBrowserNewWindow

The problem is on the newbrowser.NewWindow handler I get an error at WebBowserNewWindow, where the code is underlined in blue and when I hover over it I get the message: Name "WebBrowserNewWindow" is not declaired.
I don't recieve this problem for the newbrowser.DocumentCompleted handdler.
The private sub that I want to call is:

Private Sub WebBrowser_NewWindows(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowser)End SubCould someone please help?
Thanks
Aaron
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,545
Location
Norway
Programming Experience
10+

aaronmchale

New member
Joined
Dec 12, 2011
Messages
4
Programming Experience
3-5
[FONT=Tahoma, Calibri, Verdana, Geneva, sans-serif]Ah yes, thanks for that, although that doesnt seem to fix it :(, I was getting this error before I added the private sub.

Help?
Thanks
Aaron[/FONT]
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,545
Location
Norway
Programming Experience
10+
What is different for DocumentCompleted event, since you can't do that for NewWindow event?

By the way, I also noticed your signature for NewWindow handler is wrong. NewWindow Event
 

aaronmchale

New member
Joined
Dec 12, 2011
Messages
4
Programming Experience
3-5
Thanks for that,

I have actually fixed it (or from what I can tell I have), I looked at what the normal handler configuration is for a web browser opening in a new window, it seems at the private sub it should be system.componentmodel.canceleventargs, lets see if it works in practice.

Thanks
Aaron
 
Top Bottom