Simple Web Browser in VB.NET
Hello there my children, I hate introductions so let's just jump into making your web browser.
First of all, this is going to be done with Visual Basic .NET 2008 express edition. It should be generic enough to work with other versions of VB.NET.
So, let's start, shall we.
Create a new windows form project with VB.NET.

Resize your form to make it a little bigger.

From the toolbox, drop the web browser control into the form, of course, resize it to fit into the form.

Now add a textbox and a button at the top of the form, change the button text into "Go".

Now double click "Go" Button to get into the coding part.

Now, you need to code the action the button has to do, what action is that? Oh, taking the url from the textbox and telling the web browser to open it, of course.
The textbox name is textbox1 and the web browser control is named webbrowser1, so the code should be like this:
PHP Code:
WebBrowser1.Navigate(TextBox1.Text)

Now, your web browser would work! Awesome, right? But I know you are saying now: Raven!, but this browser is lame, no features, no nothing!
Ok Ok, kids. We are not done yet. How about you go back to the designer mode of the form.

Put a few buttons up there, how about 4 more buttons?

You know how to put an action to a button, right? just double click to code the action to do when the button is clicked in the program.
We'll add a few stuff, like going forward, going backward, refresh, and stop. Of course, change the text of each button to match the coded action.
Stop
PHP Code:
WebBrowser1.Stop()
Refresh
PHP Code:
WebBrowser1.Refresh()
Go Forward
PHP Code:
WebBrowser1.GoForward()
Go Back
PHP Code:
WebBrowser1.GoBack()


Ok now! Since we here at Insanitek love open source very much, and I know you want to see how this browser is made, take a look

It was made with the this same tutorial, with adding more stuff of course. Shiny, isn't it?
You can download the browser here.
You can download the source code here.
Have a nice day kids, and keep on programming.
|