hi, i am making a webbrowser with the webbrowser control, i want to open a new window when the user click open link in a new window, i want it to open the form created by me , instead of internet explorer.. any idea of how to do this...
Printable View
hi, i am making a webbrowser with the webbrowser control, i want to open a new window when the user click open link in a new window, i want it to open the form created by me , instead of internet explorer.. any idea of how to do this...
maybe try to create another form, call the form and pass a parameter to a friend variable on the form such that it is the address that you want to open in the new window.Quote:
Originally Posted by Pac_741
e.g.
and your calling form something like this:Code:Public Class Form2
Friend strWebURL As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If strWebURL <> "" Then
WebBrowser1.Navigate(strWebURL)
End If
End Sub
End Class
Code:Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.strWebURL = "asdf"
frm.Show()
End Sub
End Class
I don't have many examples up on my new site, but this is actually one of them.
http://www.zerosandtheone.com/exampl...erControl.aspx
kleinma, your link does not work...
Server error...
I am looking for the answer to this, but the ones I find don't work.
Yes I know, my site is currently offline for a restructure. I plan on having it back up in a few days.
I have the code at work though, so I can post it here tomorrow.
I found my answer was to add the Microsoft Web Browser component so I had access to NewWindow2 event (ieframe.dll), instead of using the one that came with .NET
yes you can do that, however it does require a few extra hoops to jump through.
You need to distribute a few extra files (the Ax interop ones that get generated). You also need to run those files through a command line utility to strong name them if you plan on strong name signing your app.