6 Replies - 4488 Views - Last Post: 06 October 2008 - 05:50 AM Rate Topic: -----

#1 jpool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-January 08

VB Web Browser Navigation.

Post icon  Posted 05 October 2008 - 12:45 AM

Hi,

I am making a simple tabbed browser in vb (2005) and I have the code below to add a new Tab and browse to a website, but what i am having trouble with is the navigation, so "Back", "Forward" etc. I can't seem to find the right code to navigate on the current Tab.

Dim tb As New Form
Dim wb As New WebBrowser
TabControl1.TabPages.Add(tb)
wb.Dock = DockStyle.Fill
wb.Navigate("about:blank")
tb.Controls.Add(wb)



I have seen code on the net like the below which builds successfully, but then fails:

System.ArgumentOutOfRangeException was unhandled

{"Index 0 is out of range.Parameter name: index"}

CType(TabControl1.TabPages.SelectedTab.Controls.Item(0), WebBrowser).GoBack()



I am sure I am missing something obvious, but hope someone can help?

Is This A Good Question/Topic? 0
  • +

Replies To: VB Web Browser Navigation.

#2 akhileshbc  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 179
  • Joined: 27-September 08

Re: VB Web Browser Navigation.

Posted 05 October 2008 - 01:35 AM

wrong forum. It should be in .net section :)
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5062
  • View blog
  • Posts: 26,437
  • Joined: 10-May 07

Re: VB Web Browser Navigation.

Posted 05 October 2008 - 01:36 AM

** Topic Moved to VB.NET **
Was This Post Helpful? 0
  • +
  • -

#4 AdamR  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 144
  • Joined: 23-September 08

Re: VB Web Browser Navigation.

Posted 05 October 2008 - 12:44 PM

This might help :)
Was This Post Helpful? 0
  • +
  • -

#5 jpool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-January 08

Re: VB Web Browser Navigation.

Posted 06 October 2008 - 03:46 AM

Great thanks, that should get me going :)
Was This Post Helpful? 0
  • +
  • -

#6 jpool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 22-January 08

Re: VB Web Browser Navigation.

Posted 06 October 2008 - 05:36 AM

Having looked at the link i can make sense of it, but can't see how to implement the Click event of say for axample my "Back" button with the example that is shown ?
Was This Post Helpful? 0
  • +
  • -

#7 AdamR  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 144
  • Joined: 23-September 08

Re: VB Web Browser Navigation.

Posted 06 October 2008 - 05:50 AM

For the record, im fairly new to VB.Net so i may be way off the mark, but i'm going to guess it will be along the lines of, adding the handler:

		AddHandler Browser.CanGoBackChanged, AddressOf BrowserCanGoBack_Changed
		AddHandler Browser.CanGoForwardChanged, AddressOf BrowserCanGoForward_Changed



then save the selected browers in a variable, and use

selectedbrowser.goback()




Like i said, not 100% on this but it may well work, heh :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1