NewWindow event in WebBrowser - Migrating from VB 6.0 to 2005

E

Ehud_A

Hi,

I have a small application that extends the webBrowser object. There is
only a single form in this application, with the webBrowser inside.
Among other things, I catch the NewWindow2 event. This is done so i
could open a new instance of my browser when a user clicks on a button
that calls the javascript window.open command (without doing it, a new
internet explorer is opened).

I migrated the project to Visual Studio 2005, .NET 2.0, but the
migration process failed to supply an appropriate code.
I saw samples for Visual Studio 2003 .NET 1.1, but it seems like there
have been changes since.

this is the VB 6.0 code:

Private Sub brwWebBrowser_NewWindow2(ppDisp As Object, Cancel As
Boolean)

Dim newFrm As frmBrowser
Set newFrm = New frmBrowser
newFrm.brwWebBrowser.RegisterAsBrowser = True

Set ppDisp = newFrm.brwWebBrowser.Object

newFrm.Visible = True
newFrm.Show

End Sub

thanks for your help
 
C

Cor Ligthert [MVP]

Ehud,

You are referencing to an webbrowser as far as I know can that only be one.

You can create two webbrowser forms by dragging the browser on it (that
could in 2003) and open than that form in the way you did.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top