Webbrowser Tutorial - Page 1 - Visual Basic .NET

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

Page 1

This tutorial describes how to make a web browser program in Visual Basic .NET

Open Visual Basic  (If you don't have the program click here to download it for free.)

Click on Project next to Create:

Visual Basic 2008 WebBrowser

Click on Windows Form Application, and name the project "Your name's Application" and then click Ok.

Visual Basic 2008 WebBrowser

You can change the form text to "your name's web browser". Click on the form and then go to properties window, then change the text property.

In the properties window, change the WindowState property to Maximized so that when the user launch the web browser, it will be maximized:

Add a Webbrowser from the toolbox.

Change the dock property

 

Visual Basic 2008 WebBrowser

Right click on the webbrowser and click on properties. In the properties window change the Anchor property to Top, Bottom, Left, Right as follows:

Adjust the size of the webbrowser on the form, and leave a space between the webbrowser and the controlbox of the form:

Visual Basic 2008 WebBrowser

Let's first assign the home page of the webbroser. The home page is the first page that appears when the Web Browser is loaded.

To do that, right click on the webbrowser and click on properties.

Change the property of URL to your favorite website:

Visual Basic 2008 WebBrowser

Add two buttons to the form and place them between the form's header and the web browser. Change the text for each button to << and >> :

Visual Basic 2008 WebBrowser

Back Button Code

The button that text is << will do the Back command:

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

Forward Button Code

The button that text is >> will do the Forward command:

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

Page: 1 2


Share This

Home | About | Contact | Privacy Policy

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