2 Replies - 663 Views - Last Post: 20 August 2009 - 02:34 PM Rate Topic: -----

#1 kaikarden  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 40
  • Joined: 11-September 08

VB9 Web Browser question

Post icon  Posted 20 August 2009 - 02:22 PM

Hey DIC! Sorry if i posted this in the wrong forum, but i have a question, im working on my own web browser in VB9 professional edition. I've created the basic browser with all of the simple commands that are practically the first things you learn how to do in VB9. my challenge is i have made a second form where you can edit all the settings of the web browser, and im kind of hung on how to actually change the homepage. so here is the line of code as it is while i type this
Form1.WebBrowser1.
does anyone know the commad that i need to use right after the final period to make it so that i can change the homepage in the browser?

for further justification that this is actually my program here's some code

Public Class Form1

	Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)

	End Sub

	Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
		WebBrowser1.GoSearch()
	End Sub

	Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

	End Sub

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		WebBrowser1.GoHome()
	End Sub

	Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
		WebBrowser1.GoBack()
	End Sub

	Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
		WebBrowser1.GoForward()
	End Sub

	Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
		WebBrowser1.Refresh()
	End Sub

	Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
		End
	End Sub

	Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
		WebBrowser1.Navigate(TextBox1.Text)
	End Sub

	Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
		Form2.Show()
	End Sub
End Class


Public Class Form2

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Form1.WebBrowser1.
	End Sub

	Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

	End Sub

	Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter

	End Sub

	Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

	End Sub
End Class


This post has been edited by kaikarden: 20 August 2009 - 02:25 PM


Is This A Good Question/Topic? 0
  • +

Replies To: VB9 Web Browser question

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: VB9 Web Browser question

Posted 20 August 2009 - 02:26 PM

Moved to VB.NET (VB9 is not VB6 :) )
Was This Post Helpful? 0
  • +
  • -

#3 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: VB9 Web Browser question

Posted 20 August 2009 - 02:34 PM

The actual home page in the WebBrowser control is set by Internet Explorer. Therefore, if you have MSN set as your home page in IE, then if you call WebBrowser1.GoHome() (the method you should call to go to the home page), the browser will get the home page setting from IE and navigate there.

If you want to create a specific method to go to a custom home page (specifically for your own IE wrapper), you can create a method like this:

	Private Sub NavHome(ByVal Browser As WebBrowser)
		Browser.Navigate("http://www.bing.com")
	End Sub



Just change the page to whatever you want and pass your WebBrowser control as the parameter for this method.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1