Help Fix my Web Browser

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 739 Views - Last Post: 06 February 2010 - 09:15 AM Rate Topic: -----

#1 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Help Fix my Web Browser

Posted 06 February 2010 - 06:24 AM

Hello. I have thankfully finished my web browser! Well, at least I thought I did until this morning I was testing it and a popup winmdow came up, then it opened in an Internet Explorer window. Basically, I want popups to appear in new tabs. I came up with this code from the internet. Here's what I've got so far:

Module Module1
    Sub addfirsttab()
        addtab("http://www.vbdotnetforums.com")
    End Sub

    Sub addtab(ByVal url)
        Dim tp As New TabPage
        Dim wb As New WebBrowser
        AddHandler wb.NewWindowExtended, AddressOf wb_NewWindowExtended
        AddHandler wb.Navigated, AddressOf wb_Navigated
        wb.Dock = DockStyle.Fill
        tp.Controls.Add(wb)
        wb.Navigate(url)
    End Sub

    Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs)
        sender.parent.text = sender.document.Title
    End Sub
End Module


and in Form1_Load I've got:
addfirsttab()

Is this how you call a method? I was told to call this method on Form1_Load but I don't quite know how.

Basically, on this code:
   Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

I get Module1.WebBrowserNewWindowExtendedEventArgs not defined.

Please can someone tell me what I'm doing wrong and help me?
Thanks,
Jonathan.

Is This A Good Question/Topic? 0
  • +

Replies To: Help Fix my Web Browser

#2 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 06:24 AM

Hello. I have thankfully finished my web browser! Well, at least I thought I did until this morning I was testing it and a popup winmdow came up, then it opened in an Internet Explorer window. Basically, I want popups to appear in new tabs. I came up with this code from the internet. Here's what I've got so far:

Module Module1
    Sub addfirsttab()
        addtab("http://www.vbdotnetforums.com")
    End Sub

    Sub addtab(ByVal url)
        Dim tp As New TabPage
        Dim wb As New WebBrowser
        AddHandler wb.NewWindowExtended, AddressOf wb_NewWindowExtended
        AddHandler wb.Navigated, AddressOf wb_Navigated
        wb.Dock = DockStyle.Fill
        tp.Controls.Add(wb)
        wb.Navigate(url)
    End Sub

    Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs)
        sender.parent.text = sender.document.Title
    End Sub
End Module


and in Form1_Load I've got:
addfirsttab()

Is this how you call a method? I was told to call this method on Form1_Load but I don't quite know how.

Basically, on this code:
   Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

I get Module1.WebBrowserNewWindowExtendedEventArgs not defined.

Please can someone tell me what I'm doing wrong and help me?
Thanks,
Jonathan.
Was This Post Helpful? 0
  • +
  • -

#3 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 06:27 AM

Hello. I have thankfully finished my web browser! Well, at least I thought I did until this morning I was testing it and a popup winmdow came up, then it opened in an Internet Explorer window. Basically, I want popups to appear in new tabs. I came up with this code from the internet. Here's what I've got so far:

Module Module1
    Sub addfirsttab()
        addtab("http://www.vbdotnetforums.com")
    End Sub

    Sub addtab(ByVal url)
        Dim tp As New TabPage
        Dim wb As New WebBrowser
        AddHandler wb.NewWindowExtended, AddressOf wb_NewWindowExtended
        AddHandler wb.Navigated, AddressOf wb_Navigated
        wb.Dock = DockStyle.Fill
        tp.Controls.Add(wb)
        wb.Navigate(url)
    End Sub

    Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs)
        sender.parent.text = sender.document.Title
    End Sub
End Module


and in Form1_Load I've got:
addfirsttab()

Is this how you call a method? I was told to call this method on Form1_Load but I don't quite know how.

Basically, on this code:
   Private Sub wb_NewWindowExtended(ByVal sender As Object, ByVal e As Module1.WebBrowserNewWindowExtendedEventArgs)
        e.Cancel = True
        addtab(e.Url)
    End Sub

I get Module1.WebBrowserNewWindowExtendedEventArgs not defined.

Please can someone tell me what I'm doing wrong and help me?
Thanks,
Jonathan.
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,352
  • Joined: 29-May 08

Re: Help Fix my Web Browser

Posted 06 February 2010 - 06:30 AM

Moderator One thread post on this is enough so the three have been merged.
Was This Post Helpful? 0
  • +
  • -

#5 Guest_Jonathan*


Reputation:

Re: Help Fix my Web Browser

Posted 06 February 2010 - 06:37 AM

View PostAdamSpeight2008, on 06 February 2010 - 05:30 AM, said:

Moderator One thread post on this is enough so the three have been merged.


So terribly sorry, my web browser said it was doing nothing, didn't realize it did. oops! will be more careful next time!
Was This Post Helpful? 0

#6 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 193
  • View blog
  • Posts: 1,097
  • Joined: 13-March 09

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:09 AM

you should put it in the NewWindow event :)
Was This Post Helpful? 0
  • +
  • -

#7 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:12 AM

View PostEndLessMind, on 06 February 2010 - 06:09 AM, said:

you should put it in the NewWindow event :)


Please can you tell me how to use the NewWindow event, this is only the second program I've made.
Was This Post Helpful? 0
  • +
  • -

#8 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 193
  • View blog
  • Posts: 1,097
  • Joined: 13-March 09

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:26 AM

View Postgerbilplay4, on 06 February 2010 - 06:12 AM, said:

View PostEndLessMind, on 06 February 2010 - 06:09 AM, said:

you should put it in the NewWindow event :)


Please can you tell me how to use the NewWindow event, this is only the second program I've made.

view the code of you project.
select you webbrowser control in the upper left combobox and then go in the the upper right combobox and find Newwindow. then add the code.
Was This Post Helpful? 0
  • +
  • -

#9 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:30 AM

Please help me, I have no idea how to use this new window event.

Thanks, I got it but I can't find new window for tab control.
Was This Post Helpful? 0
  • +
  • -

#10 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 193
  • View blog
  • Posts: 1,097
  • Joined: 13-March 09

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:37 AM

View Postgerbilplay4, on 06 February 2010 - 06:30 AM, said:

Please help me, I have no idea how to use this new window event.

Thanks, I got it but I can't find new window for tab control.

not tabcontroler..
itīs for the webbrowser controler.
so the code will execute when a new window wantīs to open.
Was This Post Helpful? 0
  • +
  • -

#11 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:43 AM

View PostEndLessMind, on 06 February 2010 - 06:37 AM, said:

View Postgerbilplay4, on 06 February 2010 - 06:30 AM, said:

Please help me, I have no idea how to use this new window event.

Thanks, I got it but I can't find new window for tab control.

not tabcontroler..
itīs for the webbrowser controler.
so the code will execute when a new window wantīs to open.


But I want it to open in a new tab so I don't have a webbrowser.
Was This Post Helpful? 0
  • +
  • -

#12 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:47 AM

If you're using a dynamically created web browser, you can either use AddHandler to add the event, or you could have your own class with events in the webbrowser.
Was This Post Helpful? 0
  • +
  • -

#13 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 193
  • View blog
  • Posts: 1,097
  • Joined: 13-March 09

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:49 AM

let me se if i understand. you want your webbroser to open plop-upīs in a new tab instead of a new windows right?
Was This Post Helpful? 0
  • +
  • -

#14 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5960
  • View blog
  • Posts: 23,238
  • Joined: 23-August 08

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:55 AM

You know, people used to learn how to program with simple tasks before jumping into more complex projects and then bugging the crap out of others to do their work for them. That way they would be considerate and not annoying gits.
Was This Post Helpful? 1
  • +
  • -

#15 gerbilplay4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 07-January 10

Re: Help Fix my Web Browser

Posted 06 February 2010 - 07:57 AM

View PostEndLessMind, on 06 February 2010 - 06:49 AM, said:

let me se if i understand. you want your webbroser to open plop-upīs in a new tab instead of a new windows right?


Yes, you are precisely right.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2