eHow launches Android app: Get the best of eHow on the go.

How To

How to Create a Web Browser in VB.net

Member
By Mike
User-Submitted Article
(4 Ratings)
VB.net
VB.net

There are a large number of browsers to choose from but did you know you can create your own in VB.net? VB.net gives you all the tools you will need to create your own browser. In this example I will create a very basic web browser. Start with this example and expand on it to fit your needs. Here is how you can create a basic web browser in VB.net.

Difficulty: Easy
Instructions

Things You'll Need:

  • VB.net
  • Internet connection
  1. Step 1

    Open VB.net.

  2. Step 2
    New Project
    New Project

    Create a new VB.net windows application by selecting New Project and then when the window appears select VB.net and windows application.

  3. Step 3
    Textbox
    Textbox

    Add a textbox to the form.

  4. Step 4
    Button
    Button

    Add a button to the form and change it's text property to "Go".

  5. Step 5
    Web Browser
    Web Browser

    Add a web browser control to the form.

  6. Step 6
    Click event
    Click event

    Double click on the button to bring up the button's click event.

  7. Step 7
    Code
    Code

    In the click event type in the code:
    WebBrowser1.Navigate(TextBox1.Text)

    This code says to take the URL that you type into the textbox and have your web browser control navigate to it.

  8. Step 8

    Run the program by pressing the F5 key on your keyboard.

  9. Step 9
    URL in Textbox
    URL in Textbox

    During runtime type "http://www.Google.com" into the textbox on the form (without the quotes of course).

  10. Step 10
    Click the Go button
    Click the Go button

    Click the Go button.

  11. Step 11
    Final Results
    Final Results

    Notice how Google.com appears in your web browser.

Tips & Warnings
  • Instead of a textbox, use a combo box and add the URL to the combobox after you click the Go button. This will save previously visited website addresses.
Resources

Comments  

mpodlesny said

Flag This Comment

on 11/19/2008 So you believe in making things more difficult then they have to be? In the world of IT we don't do things because they are cool, we do them because they are cost efficient. It saves on labor costs which invariably saves money for the client. If you want "cool", "fun" or "difficult" go build a video game.

Ryachza said

Flag This Comment

on 11/18/2008 If you are going to do that, you might as well use IE. If you want to do it the fun/difficult/intelligent way, try using a WebRequest object. Parse the resulting HTML and generate form controls. Then write a javascript engine. Using the browser control was cool like 5 years ago in VB6 (maybe). Don't bring .NET down to that level.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

eHow Computers
eHow_eHow Technology and Electronics