How to Make a Web Browser using VB.Net

0
42

This Tutorial is all about How to Make a Web Browser using VB.Net. In this tutorial you will be able to Make a Web Browser using VB.Net. So lets get Started:

  • First is open the Visual Basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

  • After that, design your form like this just like what I’ve shown you below.
    In the properties window, change the WindowState property to Maximized so that when the user launch the web browser, it will be maximized.
  • Right click on the webbrowser and click on properties. In the properties window change the Anchor property to Top, Bottom, Left, Right.Add a Webbrowser, a Button, a Textbox and a Label to the form.
  • Click the Webbrowser go to properties and set its URL to your favorite website.
  • After Designing the form. Add this Code to the Back Button.
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. WebBrowser1.GoBack()
    3. End Sub
  • Add this code to Forward Button.
    1. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    2. WebBrowser1.GoForward()
    3. End Sub
  • Then Right click on the textbox and click on properties. In the properties window, change the anchor property to Top, Left, Right. The reason we do that is because when the web browser size changes by the user, the address bar’s size will change too.
  • Change the Go button anchor property to Top, Right: (Also the Home and Refresh Button)
  • Add this code to Go Button.
    1. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    2. WebBrowser1.Navigate(TextBox1.Text)
    3. End Sub
  • Add this code to Home Button.
    1. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    2. WebBrowser1.GoHome()
    3. End Sub
  • Add this code to Refresh Button.
    1. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
    2. WebBrowser1.Refresh()
    3. End Sub
  • Finally,Click F5 to run program.

Output:

 

If you have any comments or suggestions about on How to Make a Web Browser using VB.Net, please feel free to contact our webpage.

Download How to Make a Web Browser using VB.Net Here

Other Articles Readers might read:

 

 

 

 

Facebook Comments
(Visited 48 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here