How to Make a Web Browser using VB.Net

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.
    [vbnet]
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.GoBack()
    End Sub
    [/vbnet]
  • Add this code to Forward Button.
    [vbnet]
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    WebBrowser1.GoForward()
    End Sub
    [/vbnet]
  • 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.
    [vbnet]
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    WebBrowser1.Navigate(TextBox1.Text)
    End Sub
    [/vbnet]
  • Add this code to Home Button.
    [vbnet]
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    WebBrowser1.GoHome()
    End Sub
    [/vbnet]
  • Add this code to Refresh Button.
    [vbnet]
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
    WebBrowser1.Refresh()
    End Sub
    [/vbnet]
  • 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:

 

 

 

 

1 thought on “How to Make a Web Browser using VB.Net”

Leave a Comment