Madd Eye
New Member
- Joined
- Jan 26, 2008
- Messages
- 13
- Reaction score
- 0
1. Introduction
2. Step 1
Step 2
Step 3
Step 4
1. Introduction
Have you ever wanted to write your own web browser but thought it was too hard? Well in this tutorial I will be showing you step by step on how to build your very own web browser in Visual Basic.
When Microsoft released Microsoft Internet Explorer, they distributed the SHDOCVW.DLL with it. This is the main library for exporting the Internet Explorer viewer into your programs. Visual Basic helps you to insert this control with a few easy steps
Step 1
Open Visual Basic, and Press CTRL+T or go to the Project Menu -> Components. When the Components dialog pops-up scroll down to the Microsoft Internet Controls in the Controls section, select it and press OK.
If you did the step above correctly, you should see a new icon on your Toolbox:
Step 2: Setting up the interface
In this step, you would need to add the following controls to the form:
• 4 command buttons and name them: cmdBack, cmdForward,
cmdStop, cmdHome
• 1 label control and name it: lbCaption
• 1 combobox control and name it: cboURL
• The webbrowser control you've just added, and name it: wWeb
Your form will now look something like this:
You've just finished the basic interface for your web browser application. Remember, you can always go beyond this by using the Toolbar control to make it look nicer!
Step 3: The Coding!
Now that you've finished the user interface for your web browser, comes the hard part, you have to write codes for your browser to function properly.
Open the code for your web browser form and follow the following steps.
In the cmdBack_Click() event, put in this code:
wweb.GoBack
the GoBack method makes the web browser control to go back to the previous page.
In the cmdForward_Click() event, put in this code:
wWeb.GoForward
The GoForward method makes the web browser control to go forward to another page.
In the cmdStop_Click() event, put in this code:
wWeb.Stop
The Stop method makes the web browser control stop whatever it's doing.
In the cmdHome_Click() event, put in this code:
wWeb.GoHome
The Home method makes your web browser control navigate back to the webpage that you set as home in the Internet Explorer Option.
In the cboURL_KeyDown() event, put in this code
If KeyCode = vbKeyReturn Then
wWeb.Navigate cboURL.Text
End If
That code will make the web browser control navigate to the URL you that you specified in the cboURL whenever you press the return key while typing in the combo box.
Step4: Congratulations!
You've now created your very own web browser. Tune in for the next edition of the Web Browser control tutorial for information on how to add a progress bar, status text, and advanced controlling of the web browser control.
Final product:
If you would like to try download a ready version of this tutorial please Click here
Have Fun with this Tut
2. Step 1
Step 2
Step 3
Step 4
1. Introduction
Have you ever wanted to write your own web browser but thought it was too hard? Well in this tutorial I will be showing you step by step on how to build your very own web browser in Visual Basic.
When Microsoft released Microsoft Internet Explorer, they distributed the SHDOCVW.DLL with it. This is the main library for exporting the Internet Explorer viewer into your programs. Visual Basic helps you to insert this control with a few easy steps
Step 1
Open Visual Basic, and Press CTRL+T or go to the Project Menu -> Components. When the Components dialog pops-up scroll down to the Microsoft Internet Controls in the Controls section, select it and press OK.
If you did the step above correctly, you should see a new icon on your Toolbox:
Step 2: Setting up the interface
In this step, you would need to add the following controls to the form:
• 4 command buttons and name them: cmdBack, cmdForward,
cmdStop, cmdHome
• 1 label control and name it: lbCaption
• 1 combobox control and name it: cboURL
• The webbrowser control you've just added, and name it: wWeb
Your form will now look something like this:
You've just finished the basic interface for your web browser application. Remember, you can always go beyond this by using the Toolbar control to make it look nicer!
Step 3: The Coding!
Now that you've finished the user interface for your web browser, comes the hard part, you have to write codes for your browser to function properly.
Open the code for your web browser form and follow the following steps.
In the cmdBack_Click() event, put in this code:
wweb.GoBack
the GoBack method makes the web browser control to go back to the previous page.
In the cmdForward_Click() event, put in this code:
wWeb.GoForward
The GoForward method makes the web browser control to go forward to another page.
In the cmdStop_Click() event, put in this code:
wWeb.Stop
The Stop method makes the web browser control stop whatever it's doing.
In the cmdHome_Click() event, put in this code:
wWeb.GoHome
The Home method makes your web browser control navigate back to the webpage that you set as home in the Internet Explorer Option.
In the cboURL_KeyDown() event, put in this code
If KeyCode = vbKeyReturn Then
wWeb.Navigate cboURL.Text
End If
That code will make the web browser control navigate to the URL you that you specified in the cboURL whenever you press the return key while typing in the combo box.
Step4: Congratulations!
You've now created your very own web browser. Tune in for the next edition of the Web Browser control tutorial for information on how to add a progress bar, status text, and advanced controlling of the web browser control.
Final product:
If you would like to try download a ready version of this tutorial please Click here
Have Fun with this Tut
Last edited: