Creating a Web Browser in VB.Net

This was the first thing I ever learned in VB i was completely honest i don't know why but if i learned it at the start anyone can do it. Ok lets get started.
1)File >new project>windows application (name it web browser or what ever)
1.)Posted Image


2) Make screen size to any size but big enough to see an entire web browser.

3) Add a Panel and dock it to the top (when clicked on the panel. Properties window on the right “Dock" )
3.)Posted Image

*Docking it
*Posted Image


4) Personally i don't like the default color but that is not important but if you insist on changing the color...
Posted Image





5)I have made many of these web browsers in the past just to keep it refreshed in my memory because if you do it right it can be a fun tool. So I created Back, Forward, Refresh and a GO! Button The attachment at the bottom of the page if you can’t be bothered making your own or you can just us Labels (basic text).

5) Add a text box and a buttons to the panel
5.) Here’s what i got so far >
Posted Image



6) I got the colors to change on the text box in the properties menu, thats not important i just did it for style.


7) Web browser. Just drag and drop it
7.)Posted Image


*ok don't rename anything ( you can change the text but NOT the name unless you change the coding) e.g. Say *originally it was " textbox1" and you rename it "Type here" you would have to put "Typehere.Text" understand? )
 
    Private Sub PictureBox4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox4.Click
        
WebBrowser1.Navigate(TextBox1.Text)
    End Sub

Now I didn’t rename the picture boxes and i double clicked them to open in code window starting with Back>refresh>forward>go  

Back Button  

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

Forward Button

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


Refresh Button

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








So you can just copy and past the code its that easy

Here’s what the finished web browser will look like in Debug mode

**You can also make a homepage easily by changing the URL value in the properties window just click the web browser we added earlier and the properties will change fo r that specific item
Posted Image


Here is the finished product running.

Posted Image

 

 
 
 

This entry was posted in , . Bookmark the permalink.

Leave a reply