• Welcome to ForumKorner!
    Join today and become a part of the community.

[Pictures] - [TUT]How to make a simple WebBrowser in VB 2010![TUT] - [ Pictures]

Monetizer

Member
Reputation
0
This tutorial was created by Currymanz and he has given me permission to share it with every other forums!


Hey Dark-Forums, This is a tutorial created by Currymanz, which is to help beginners learn coding

Required items in order to successfully follow this tutorial:

  • Visual Studio/basic 2010
  • Some coding skills
  • A brain
  • Able to understand and read English!

Firstly, you must open Visual Basic 2010 and then click new project and choose the windows form application as explained in the following picture:

vbtut1.png

Secondly, you can change the name of the browser and the size by doing the following:


vbtut2.png

Thirdly, you must add a panel by simply clicking the toolbox in the top left corner and do the following:

vbtut3.png

Fourthly, you must go to toolbox (once again) and choose WebBrowser and do the following:

vbtut4.png

Fifthly, you must open toolbox and add buttons (five of them in fact) and do the following with them:

vbtut5.png

Sixthly, you must re-name the buttons into what I have done in the following picture:

vbtut6.png

Sevently, you must add a textbox and extend it as I have done. You must also add a label, all of the required objects in this step are in the toolbox.

vbtut7.png

Eighthly, you must add a statusstrip at the bottom of the webbrowser as I have done, you can obtain the status bar from the toolbar.

vbtut8.png

Tenthly, it is finally time to get some coding done!, double click the buttons before you add the codes, he codes for the buttons are below:

Back Button:
Code:
WebBrowser1.GoBack()

Forward Button:
Code:
WebBrowser1.GoForward()

Refresh Button:
Code:
WebBrowser1.Refresh()

Stop Button:
Code:
WebBrowser1.Stop()

Go Button:

Code:
WebBrowser1.Navigate(Textbox1.Text)

After you have added the codes for the buttons you are done!, the codes should be something like this:

vbtut9.png

This is the whole code:


Code:
Public Class Form1

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

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

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        WebBrowser1.Stop()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        WebBrowser1.Refresh()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        WebBrowser1.Navigate(TextBox1.Text)
    End Sub
End Class

Finally, after you have done everything and added all the codes etc, you can change the icon of the browser and the name of the things.

This is how it looks like:


vbtut10.png

If you have any questions, feel free to post in this thread or private message me!

Thank you and enjoy!
 

Skrewdriver

Member
Reputation
0
nice:) tut mate.. very usefull
 
Reputation
0
This is an amazing tutorial. Its wrote in proper order and it also includes pictures which can help others a lot. I rate this 5/5.
 

Jeff

New Member
Reputation
0
Awesome tutorial!

I've read most of the tutorials and guides posted in this community.

Looks great. :)
 
Top