Webbrowser Tutorial - Page 1 - Visual Basic .NET
Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013
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:
Click on Windows Form Application, and name the project "Your name's Application" and then click Ok.
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
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:
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:
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 >> :
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