WebBrowser Control

The Basics

Hello, I’m Paul Hughes and I will be taking the steps of building a web browser through Visual Basic.

You may think that building such a complex piece of software would take months and perhaps years to do properly. Well no you are wrong. With Visual Basic you can have a working Browser with just one line of code! The reason for this is the library known as SHDOCVW.DLL. This is the main file in Internet Explorer, and you can use it too.

Start a new project, and then to use the web browser control, go to the Components menu and select Microsoft Internet Controls. Click on OK and you should have a new icon which looks something like this:

Click on it, and then draw the size of the browser windows you want on the form. You should now what appears to be a white box. Now for the one piece of code which will make it work. Double click on the form.

Type in the following code in the code window(in the event known as Form_load)

Webbrowser1.Navigate "Http:\www.thtproductions.co.uk"

Exit the code window and start the program. If you are on the Internet, The browser should now go to the THT Productions Website. If you aren’t connected a Dial-Up Networking Box will come with your connections etc. Well Done you have made a extremely simple browser!!

This is something like what you should end up with….

You might also like...



Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Every language has an optimization operator. In C++ that operator is ‘//’”