Change WebBrowser Home Page - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

In this tutorial, I'll show you how to change browser home page.

First you need to add a new item to your project settings:
Click on Project, then click on your project properties  (Last item of the menu)

Click on Settings tab

Under Name add the word "Home", and add a url under Value "http://www.google.com"

Add a browser to your application and 2 buttons.
The first button is used to Change Home Page and the second is used to Go to Home Page

"Change Home Page" button:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim response As Object
        response = InputBox("Please Enter Home Page URL", "Webbrowser", My.Settings.Home)
        My.Settings.Home = response
        My.Settings.Save()
    End Sub

Go to Home Page button:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    WebBrowser1.Navigate(My.Settings.Home)
End Sub


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.