Results 1 to 7 of 7

Thread: [2005] new window event...

  1. #1

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    [2005] new window event...

    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...

  2. #2
    Junior Member
    Join Date
    Oct 2007
    Posts
    18

    Re: [2005] new window event...

    Quote Originally Posted by Pac_741
    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.

    e.g.

    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
    and your calling form something like this:
    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

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] new window event...

    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

  4. #4
    Junior Member
    Join Date
    Mar 2006
    Location
    Minnesota
    Posts
    24

    Re: [2005] new window event...

    kleinma, your link does not work...
    Server error...

    I am looking for the answer to this, but the ones I find don't work.

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] new window event...

    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.

  6. #6
    Junior Member
    Join Date
    Mar 2006
    Location
    Minnesota
    Posts
    24

    Re: [2005] new window event...

    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

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] new window event...

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width