none
Popup Block for my webbrowser visual basic(vb.net) help RRS feed

  • Question

  • Hello! =)

    I am making a non-tabbed simple web-browser.

    If you go to a website like... say...

    www.verynicesites.com

    in a vb.net simple webbrowser and if you hover the mouse over it click on 'visit'. It will open it in your default webbrowser. I have tried making it so that it would douplicate my project form and have the site on instead of a popup on another webbrowser. I have tried this with this code:

    Private Sub WebBrowser1_NewWindow2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
            e.Cancel = True
            Dim newBrowser As Form1 = New Form1
            newBrowser.Show()
        End Sub

    It opens my webbrowser project (as expected) but instead opens on the home-page (Google) how can I make it so that it opens the webpage link that I clicked on?

    Thanks,

    PS: Sorry if I didn't explain it properly. :)

    Saturday, November 30, 2013 5:54 PM

Answers

  • Hi Guys,

    To be honest, I didn’t understand this issue. If you want to open a hyperlink in Web Browser control. I created a sample about this issue and open the link provided by you. I noticed that there is a Script Error popup. If you want to block this popup. Try this,

    WebBrowser.ScriptErrorsSuppressed Property

    Something looks like,

     

        Private Sub BtnBrowser_Click(sender As Object, e As EventArgs) Handles BtnBrowser.Click
            Browser.ScriptErrorsSuppressed = True
            Me.Browser.Navigate(TxtAddress.Text)
        End Sub

    The result is shown in the follow figure,

    If I misunderstood or my points are incorrect, please feel free to let me know.

    Have a nice time!

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 2, 2013 6:51 AM
    Moderator
  • WebBrowser Control

    WebBrowser Control Overviews and Tutorials

    WebBrowser Control - Reference for Visual Basic Developers


    Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.


    Monday, December 2, 2013 11:07 AM

All replies

  • Hi Guys,

    To be honest, I didn’t understand this issue. If you want to open a hyperlink in Web Browser control. I created a sample about this issue and open the link provided by you. I noticed that there is a Script Error popup. If you want to block this popup. Try this,

    WebBrowser.ScriptErrorsSuppressed Property

    Something looks like,

     

        Private Sub BtnBrowser_Click(sender As Object, e As EventArgs) Handles BtnBrowser.Click
            Browser.ScriptErrorsSuppressed = True
            Me.Browser.Navigate(TxtAddress.Text)
        End Sub

    The result is shown in the follow figure,

    If I misunderstood or my points are incorrect, please feel free to let me know.

    Have a nice time!

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 2, 2013 6:51 AM
    Moderator
  • WebBrowser Control

    WebBrowser Control Overviews and Tutorials

    WebBrowser Control - Reference for Visual Basic Developers


    Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.


    Monday, December 2, 2013 11:07 AM