Important alert: (current site time 7/16/2013 4:17:03 AM EDT)
 

VB icon

The 15 minute WWW browser

Email
Submitted on: 6/27/1997
By: Ian Ippolito (vWorker)  
Level: Beginner
User Rating: By 8 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 80944
author picture
(About the author)
 
     It took Netscape months to create their first browser, and Microsoft wasnt able to follow up that trick until years later. But you can create a world wide web browser in less than 15 minutes, even if you are a Visual Basic novice! The following tutorial will show you how to create an Internet browser using the Microsoft Internet Control (part of Internet Explorer). My only caveat is that if you end up putting the big-boys out of the Internet business with your creation, that you give me a litle credit in your About box! ;)
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: The 15 minute WWW browser
' Description:It took Netscape months to create their first browser, and Microsoft wasnt able to follow up that trick until years later. But you can create a world wide web browser in less than 15 minutes, even if you are a Visual Basic novice! The following tutorial will show you how to create an Internet browser using the Microsoft Internet Control (part of Internet Explorer). My only caveat is that if you end up putting the big-boys out of the Internet business with your creation, that you give me a litle credit in your About box! ;)
' By: Ian Ippolito (vWorker)
'
' Side Effects:If you are running Visual Basic 5.0 or 6.0 the Microsoft Internet Controls are included with VB, so you don't need to do anything special to get them. If you are running an older version, you may still be able to get the controls for free from Microsoft's site at www.microsoft.com.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=425&lngWId=1'for details.'**************************************

1)Create a new Visual Basic project.
2)Add the Microsoft Internet Controls to your project. In 
VB6 you add new custom controls to a project by going to
the Project menu and choosing the Components sub-menu, and
choosing the control you want to add. In other versions of 
VB, consult your help on adding custom controls. The name 
of the custom control is: Microsoft Internet Control. This 
will add two icons to your toolbox. Place the one that 
looks like a globe (the Web Browser control) on your form 
by double-clicking it. This control will display the web 
page, so make sure you size it so that it looks presentable.
3)Next, place a text box on the upper portion of the form--
above the WebBrowser Control. This will be your browser's 
address bar. To complete the address bar, place a button 
next to it. Change the Caption property of the button to:&Go
4)Now add the following code to your form:
Private Sub Command1_Click()
 WebBrowser1.Navigate Text1
End Sub
That is it! Run your project and type www.microsoft.com 
into the text box and press the GO button. (Dont forget to 
start your Internet connection if its not already up). The 
page will load and display just like a browser!
Now that you have an idea of how simple the control is to 
use, you can take a little more time to create some more 
sophisticated functionality for your browser:
1)Since the world wide wait can be taxing on your browser 
users, you can create a status bar at the bottom of your 
form that lets them know how much of their page has loaded. 
You can use the following web browser events (see the 
Microsoft Internet Controls help file, if you need examples)
WebBrowser1_DownloadBegin
WebBrowser1_DownloadComplete
WebBrowser1_ProgressChange
2)Create a menu system on your form--just like IE and 
Netscape. See the VB help if youve never done this before. 
You'll want to at least create &File and &Exit. 
3)Create a combobox instead of a text box that remembers 
old URLs.
4)Let your imagination run wild!
5) For more features, check out the other browser 
submissions to this site. An outstanding example is:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2628
6)Some other features created by other users:
Passive Matrix(mailto:Passive_matrix@hotmail.com)
Here are some helpful button commands...
back button 
WebBrowser1.GoBack
Forward button
WebBrowser1.GoForward
refresh
WebBrowser1.Refresh
stop
 WebBrowser1.Stop
home 
WebBrowser1.Navigate ("www.cow.com")
By William:mailto:wfloor@rendo.dekooi.nl
An answer to the questions about the favorites and the bookmarks:
1) Make a 
commandbutton cmdAdd
2) Make a commandbutton cmdFav
3) Make a listbox 
lstFavs
The code for cmdAdd:
Private Sub cmdAdd_Click()
 FN = 
FreeFile
 Open "favs.txt" For Append As FN
 Print #FN, txtUrl.Text & 
Chr(13)
 Close #FN
End Sub
The code for cmdFav:
Private Sub 
cmdFav_Click()
 On Error Resume Next
 FN = FreeFile
 Open 
"favs.txt" For Input As FN
 lstFavs.Visible = True
 Do Until 
EOF(FN)
Line Input #FN, NextLine$
lstFavs.AddItem NextLine$
 
 Loop
 Close #FN
End Sub
The code for lstFavs:
Private Sub 
lstFavs_Click()
 txtUrl.Text = lstFavs.List(lstFavs.ListIndex)
 
txtUrl_KeyPress 13
 lstFavs.Visible = False
 Close #FN
End Sub
By:CheaTzZ mailto:cheatzz@xcheater.com
To print:
Private Sub printmenu_Click()
 Dim eQuery As OLECMDF
 On 
Error Resume Next
 eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
 
If Err.Number = 0 Then
If eQuery And OLECMDF_ENABLED Then
 
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""
Else
 MsgBox "The Print command is currently disabled."
End If
 Else
MsgBox "Print command Error: " & Err.Description
 
End If
End Sub
======================
To open up new window:
Private 
Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
 On Error 
Resume Next
 Dim frmWB As Form1
 Set frmWB = New Form1
 
 Set 
ppDisp = frmWB.WebBrowser1.Object
 frmWB.Visible = True
 Set frmWB = 
Nothing
If you want to cancel the new window, Cancel = True.
For a proper progressbar:
Private Sub WebBrowser1_ProgressChange(ByVal 
Progress As Long, ByVal ProgressMax As Long)
 On Error Resume Next
 
ProgressBar1.Max = ProgressMax
 ProgressBar1.Value = Progress
End 
Sub
To show the percentage:
Progress * 100 / ProgressMax
by: Bones mailto:kacantu@webaccess.net
You can easily view the source of the webpage you're
viewing by using 2 
controls: A RichTextBox control,
and the microsoft internet transfer 
control.
If your internet transfer control is Inet1, and your
Textbox is 
RichTextBox1, then use the following code
download and view a page's 
source:
RichTextBox1.Text = Inet1.OpenURL(" address ")
The address must be 
the valid URL of an .htm or .html
file.


Other 69 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
4/16/1999 10:41:00 PMT. R. Kapoor

Good effort ! Keep it up !!
(If this comment was disrespectful, please report it.)

 
4/20/1999 3:55:00 PMFrankie (FrEk)

WaT Iz ThE NaMe Of ThE VBX UsEd If I'm Using VB3?
(If this comment was disrespectful, please report it.)

 
4/20/1999 9:29:00 PMHappydude

This rocks.
(If this comment was disrespectful, please report it.)

 
4/22/1999 5:43:00 AMRodney Botelho

wow. your a genuis
(If this comment was disrespectful, please report it.)

 
4/26/1999 9:30:00 AMPassive Matrix

Here are some helpful button commands...
back button
WebBrowser1.GoBack
Forward button
WebBrowser1.GoForward
refresh
WebBrowser1.Refresh
stop
WebBrowser1.Stop
home
WebBrowser1.Navigate ("www.cow.com")

I would like to see something on how to do bookmarks.
(If this comment was disrespectful, please report it.)

 
4/26/1999 9:52:00 AMPassive again

also might want to put On error resume next. for example

Private Sub Picture3_Click()
On Error Resume Next
WebBrowser1.GoBack
End Sub

this way you will not get an error when the buttons are clicked more than once.
Also try adding a FTP client to your browser, I will have a tutorial up on that soon.


(If this comment was disrespectful, please report it.)

 
4/26/1999 2:33:00 PMoCatt

The help file you need is iexplore.hlp
It should be somewhere in your windows
directory.

To make a progress bar, use those events
Mr.Ippolito described. The progress bar
is another ocx control you add to your form.
It has a Value property that can be set
from 0 to 100. Guess what it does :)
(If this comment was disrespectful, please report it.)

 
5/1/1999 7:44:00 PMIan Ippolito

Paul

If your Status bar is StatusBar1 and
your WebBrowser is WebBrowser1 then the code would be

StatusBar1.Panels(1).Text =
WebBrowser1.LocationURL
(If this comment was disrespectful, please report it.)

 
5/9/1999 9:56:00 AMCosmin

That's work!
I'm so glad that now I have my Internet
browser


(If this comment was disrespectful, please report it.)

 
5/14/1999 7:12:00 PMThomas

Sorry, the webbrowsercontrol is perfect. But you are not allowed to deliver it. The other way, deliver without the ocx needs to deliver the internet explorer with your program. so, it doesn't help you in the end. i apologise for my bad english, but i think you have to know this. my question: How can i get a browser for VB 5 Prof. without licenseproblems . thank you.
(If this comment was disrespectful, please report it.)

 
5/28/1999 12:43:00 PMPhiLL

This is some GREAT code! Use it - very simple to use!

Check out my web site
at: http://come.to/phill

(If this comment was disrespectful, please report it.)

 
6/7/1999 6:14:00 PMMichael-Andrews

This Is The Best Thing I Have Seen Here!!!!! :) Thanks!!!
(If this comment was disrespectful, please report it.)

 
6/12/1999 8:10:00 AMIan Ippolito

Ajay,

The easiest way to do it is to just Install Internet Explorer on the end user's computer and not bother with the setup program.

Ian
(If this comment was disrespectful, please report it.)

 
6/12/1999 11:43:00 AMAmitava Sen

Hi Ian,
the programs real cool. But requires a couple of changes.
Overall the smallest code for a well performing program I have ever seen.

(If this comment was disrespectful, please report it.)

 
6/13/1999 12:14:00 PMDevrishi Bhogra

Hi! Ian
People like you are rare !

Thanks for such compact codes.

Devrishi Bhogra
Faridabad,India
(If this comment was disrespectful, please report it.)

 
6/16/1999 10:59:00 AMWilliam

An answer to the questions about the favorites and the bookmarks:
1) Make a commandbutton cmdAdd
2) Make a commandbutton cmdFav
3) Make a listbox lstFavs
The code for cmdAdd:
Private Sub cmdAdd_Click()


FN = FreeFile
Open "favs.txt" For Append As FN
Print #FN, txtUrl.Text & Chr(13)
Close #FN
End Sub

The code for cmdFav:

Private Sub cmdFav_Click()

On Error Resume Next
FN = FreeFile
Open "favs.txt" For Input As FN
lstFavs.Visible = True


Do Until EOF(FN)
Line Input #FN, NextLine$
lstFavs.AddItem NextLine$
Loop

Close #FN
End Sub

The code for lstFavs:

Private Sub lstFavs_Click()

txtUrl.Text = lstFavs.List(lstFavs.ListIndex)
txtUrl_KeyPress 13
lstFavs.Visible = False
Close #FN
End Sub

(If this comment was disrespectful, please report it.)

 
6/17/1999 6:03:00 AMWilliam

lHey, its me again! If you have any questions about the source above, just e-mai me. I can send you the source, if you want to!
(If this comment was disrespectful, please report it.)

 
6/24/1999 2:28:00 PMBob

Hehehe...kewl. But you've said that it took Mircosoft a long time to build their webbrowser...ok. But you're using theirs! Try a right mouse click on the control during run time...
(If this comment was disrespectful, please report it.)

 
6/24/1999 9:40:00 PMCheaTzZ

To print:

Private Sub printmenu_Click()
Dim eQuery As OLECMDF

On Error Resume Next
eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
If Err.Number = 0 Then
If eQuery And OLECMDF_ENABLED Then
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""
Else
MsgBox "The Print command is currently disabled."
End If
Else
MsgBox "Print command Error: " & Err.Description
End If
End Sub

======================
To open up new window:

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
On Error Resume Next
Dim frmWB As Form1
Set frmWB = New Form1

Set ppDisp = frmWB.WebBrowser1.Object

frmWB.Visible = True
Set frmWB = Nothing

If you want to cancel the new window, Cancel = True.

- CheaTzZ
(If this comment was disrespectful, please report it.)

 
6/24/1999 9:47:00 PMCheaTzZ

For a proper progressbar:

Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
ProgressBar1.Max = ProgressMax
ProgressBar1.Value = Progress
End Sub

To show the percentage:
Progress * 100 / ProgressMax

- CheaTzZ
(If this comment was disrespectful, please report it.)

 
6/24/1999 11:51:00 PMRandy

Hey -

Kay, I Know The Location URL is
StatusBar1.Panels(1).Text = WebBrowser1.LocationURL

Well, When You Hover over a Link on The Website How Do You Display The Webpage Address of The Link You are Hovering over?

Kay, Last Question. How Do You Display The Website's Title on The Titlebar, Example: Welcome To my Site - My Web Browser?

Is There Sum Kinda Help File For The Microsoft Internet Controls OCX?

Thanx and Write Back A.S.A.P.!!
-Randy

(If this comment was disrespectful, please report it.)

 
6/26/1999 1:32:00 PMCheaTzZ

Randy, or anyone who wants to know:

Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
StatusBar1.Panels(1).Text = Text
End Sub
================

Private Sub WebBrowser1_TitleChange(ByVal Text As String)
Me.Caption = Text & " - MyBrowser"
End Sub

- CheaTzZ
(If this comment was disrespectful, please report it.)

 
6/29/1999 6:53:00 PMSteve

On the contrary, I wrote a code that does convert it all, and it took me about a month to do. The place I got stuck was tables. Frames I even managed. For the browser I used a richtextbox. If there were frames I used more richtextboxes, with splitters. But tables have me stumped with a richtextbox. I have no idea how to do them in it. Anyway, the code wasn't as fast as ie, or netscape, but then it's in vb, which by itself is far slower. But overall, it does a pretty good job of displaying a webpage. I did go one step beyond them in one aspect. If you have ever looked at an older version of ie which didn't support tables it would just sort of show the table html, mine if it sees the table html just cuts it out of the html. This of cource will totaly kill most pages with tables, but at least the page shows up. Anyway, great source though. I think you did a good job. But it is just internet explorer thats doing the work.
(If this comment was disrespectful, please report it.)

 
7/11/1999 7:37:00 AMBones

Randy asked how to view the source of a page.
An HTML file is really just a plain text file
with a list of commands. If you re-open the webpage
you are viewing into a multi-line text box, you be
viewing the source of the page. So all you have to do
is re-open the webpage from your browser into the
multi-line text box of a new form (a BIG text box,
of course).
(If this comment was disrespectful, please report it.)

 
7/18/1999 12:14:00 AMBones

You can easily view the source of the webpage you're
viewing by using 2 controls: A RichTextBox control,
and the microsoft internet transfer control.
If your internet transfer control is Inet1, and your
Textbox is RichTextBox1, then use the following code
download and view a page's source:
RichTextBox1.Text = Inet1.OpenURL(" address ")
The address must be the valid URL of an .htm or .html
file.
(If this comment was disrespectful, please report it.)

 
7/20/1999 7:21:00 AMRod Sinclair

This Code Is Very Useful Even If it Does Use IE. Thanks A Million Ian.

Rod
(If this comment was disrespectful, please report it.)

 
7/24/1999 8:25:00 PMKnut

For anyone who's interested, you can easily go to the home or search page registered on the system with the gohome and gosearch methods of the web browser control. Other useful properties can also be found in the object browser.
(If this comment was disrespectful, please report it.)

 
7/28/1999 9:09:00 AMMatrix

Who really cares if the browser is connect to IE, as long as we use it and have fun or get practice, it doesn't matter. ;-)
(If this comment was disrespectful, please report it.)

 
7/28/1999 5:11:00 PMmeiscow

yeah what does it matter if we have fun with it!!
(If this comment was disrespectful, please report it.)

 
7/29/1999 2:05:00 AMStefanos

Does anyone know how to zoom an html page in any size i want. For example resize the form with the webbrowser control and resize the fonts , the picture and etc in the page so that at any size i can see the whole page even with tiny fonts and pictures... like the new Opera browser does it...
I'm looking for help...ian help...
(If this comment was disrespectful, please report it.)

 
8/2/1999 7:33:00 AMAnders & Ron

Great Code!!!

This is realy Cool

Keep up the good work

Anders & Ron
Denmark
(If this comment was disrespectful, please report it.)

 
8/2/1999 11:01:00 PMTiggermcat

HELP HELP HELP HELP !!!!!!!!!!!
Ok heres how it goes. I made a coll web browser and it wont work on anyones computer but ones with vb6.0. If i try on other computer it come up with an error with shdocvw.dll. HElp HElp Help.
(If this comment was disrespectful, please report it.)

 
8/5/1999 10:45:00 PMChad

Please help, I can not figure a way to get my progress bar to show progress. What am I doing wrong?
(If this comment was disrespectful, please report it.)

 
8/6/1999 3:58:00 AMKnightCyrus

Tiggermcat what your problem is, is that you aren't providing some of the files that are needed, make it and install program that
way it will come with all the necicary files that it will need.
(If this comment was disrespectful, please report it.)

 
8/10/1999 2:36:00 PMArthur Chaparyan

You should change the name to 5 minute browser. :-) Arthur
(If this comment was disrespectful, please report it.)

 
8/20/1999 7:51:00 AMJoe

Sigh...some people just aren't listening.

The browser control in this sample IS
IE. If you dont have IE installed it wont work.
Thats why the "shdocvw.dll" error message is appearing. You cant distribute the files to make it work, partly because your not allowed and partly because it just does not work.

The user MUST have IE installed or your code wont work.
(If this comment was disrespectful, please report it.)

 
8/29/1999 10:04:00 PMVoiceOne

Awesome code!! How do you delete something from your favorites list though?... someone please help
(If this comment was disrespectful, please report it.)

 
9/3/1999 8:40:00 AMBrian Searle

How do you change the font of an IE instance using the execwb method. I've tried and it doesn't work, can anyone explain how to do this?
(If this comment was disrespectful, please report it.)

 
9/3/1999 11:13:00 AMNicky

My browser doesn't work... can somebody send me their Project files? I use VB4 and I'm a beginner
(If this comment was disrespectful, please report it.)

 
9/9/1999 8:30:00 AMserene

Do u know any way in viewing a html page in a browser create by VB and then if the user highlight certain portion then that certain portion html code can be cut and paste into some other place. Just like what Frontpage can do . Can VB do that ?
Thanks if u can answer this questions !
(If this comment was disrespectful, please report it.)

 
9/10/1999 10:09:00 AMZerO Invasion

hello guys
this browser require proxy server for me
how can i add the proxy server
without it i can't surf
(If this comment was disrespectful, please report it.)

 
9/11/1999 6:20:00 PMfrank

Great browser, keep it up guys...
(If this comment was disrespectful, please report it.)

 
9/14/1999 8:40:00 AMZimm

Does anyone know how to add a FIND similar to the one on the Edit menu of IE. I want to type in a word in a text box and click a button and have that word highlighted on the HTML page. If anyone could help let me know. Thanks
(If this comment was disrespectful, please report it.)

 
9/16/1999 12:39:00 PMTweaker

This is a longshot but I was wondering if anyone knows how to
make a directory listing of someone's website instead of loading
the default html like index.html. Is it possible and if so how
do you do it?
(If this comment was disrespectful, please report it.)

 
9/27/1999 8:24:00 PMMad scientist

Doing something crazy!
You can upload your web proxy log or any other file with URL into an access database or ADO data-store. Now you hook up a ADO aware control like DataGrid and using a timer control go through each URL and have the IE control load the URL. You now have an automated web browser. You can even simulate the time between URLs if you have your proxy log. We wrote one in house to support the crime investigators
(If this comment was disrespectful, please report it.)

 
9/30/1999 11:26:00 AMLouis

Not bad! i would like to see more on create bookmarks in browser.
(If this comment was disrespectful, please report it.)

 
10/11/1999 9:19:00 AMbobby

how can i make the viewing area scrollable because when i open it only a portion of the page is viewable not the whole page
(If this comment was disrespectful, please report it.)

 
10/12/1999 9:41:00 AMDataBit

This is to the people that keep making the statement "You are just using IE". It is using IE most of us know that, but it is kind of like making your own "skin" for IE. That way you get to make it look however you want. I have made one that makes my job easier by having my favorites listed as buttons at key point. Or you can make you code skinable so that anyone can develope there own skins. IE will not let you do that by default...

As for my question: How do you make a History???
(If this comment was disrespectful, please report it.)

 
10/12/1999 10:10:00 PMsnigdha

thank you very much for providing this code
(If this comment was disrespectful, please report it.)

 
10/23/1999 12:29:00 AMgLiTchEn

i luv the fact that i'm makin my own browser with the IE stuff, but i'm still stuck on trying to do a "View Source" on the menu for my browser. I've seen many codes for View Source, but none of them work for me... someone help???? pleez??? email me or post a reply here... =] thank you..

(If this comment was disrespectful, please report it.)

 
10/23/1999 12:32:00 AMgLiTchEn

oh yeah, one more thing.... does anybody know how to make it so that when you click on a link on a page or on a bookmark the url of the new page shows up on the text box where the addy is supposed to go?
i'm tired of going to sites and not seeing their urls on my screen when i get there... =\
pleez help with that too... thank you =]
(If this comment was disrespectful, please report it.)

 
10/28/1999 8:38:00 PMDaniel Errante

Ian you really found out how to get tons of users to get attracted to the ocx!
(If this comment was disrespectful, please report it.)

 
11/7/1999 4:56:00 PMphil

anybody know how to make a button that opens a dialog so u can send email?
(If this comment was disrespectful, please report it.)

 
11/12/1999 6:29:00 PMMB

DataBit makes a good point. This seems to be exactly what NeoPlanet did. Why else would you need IE 4.0+ to run it.
(If this comment was disrespectful, please report it.)

 
11/12/1999 11:56:00 PMphil

i need help on making "smart" buttons on my browser, meaning that they disable when they should and enable when they should and show diabled and enabled pictures when they should.
(If this comment was disrespectful, please report it.)

 
11/15/1999 5:36:00 PMDaniel Errante

If you want to start a mail message window, type:
Shell "Start.exe mailto:" & "emailaddresshere", 0
(If this comment was disrespectful, please report it.)

 
12/15/1999 6:05:15 AMAlberto

Anyone knows how to find a text in a page (like the Edit/Find option in IE).
I've tried this with the web browser but is always disabled.

If eQuery And OLECMDF_ENABLED Then
webVisualizador.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, "", ""
Else
MsgBox "Find is not enabled"
End If

I've also tried to pass the focus to the web browser, but still is disabled.

Any idea?

Thanks
(If this comment was disrespectful, please report it.)

 
12/16/1999 10:12:34 AMPeter Loft Jensen

Hello there!

I would like to know, if it's possible to make a function, that can for example remove a banner, or just some few lines of HTML coding...?

If looked almost all places, but can't get it to work, or find a source that can do the trick.

Please help!
(If this comment was disrespectful, please report it.)

 
12/22/1999 3:27:31 PMGregC

To have the browser view source, just like IE's does - in Notepad - put this code in your mnuViewSource_Click event (or whatever you've called the menu.

brwWebBrowser.Navigate "view-source:" & brwWebBrowser.LocationURL

To have a history, use a combo box for the address line, not a text box. When the user navigates to a new URL, add that URL to the combo box. You might want to do a check and make sure you're not adding an address that's already been visited.


(If this comment was disrespectful, please report it.)

 
12/25/1999 4:38:10 PMAdam Scott

I havn't downloaded your browser so i don't know if it has a combo bar , but if it does I hate when you can't get pervious locations that you have been to just won't go away and you can't delete them, so i think you sould make a special options button where you can remove those locations...

So use this code to do it:
Sub Command1_Click
Combo1.Clear
End Sub

I think alot of people would like that on their web browsers.
(If this comment was disrespectful, please report it.)

 
12/26/1999 4:42:23 AMsad

Who made the OCX.....yep MicroSoft.

(If this comment was disrespectful, please report it.)

 
1/5/2000 4:08:14 PMDan

All I get is error 424
WebBrowser1.Navigate Text1
I followed the quick instructions and for me--no winsock program I make works.
I did control t then microsoft winsock controls 6.0
I'm using VB 6.0
Whats going on?!?
(If this comment was disrespectful, please report it.)

 
1/5/2000 8:21:49 PMNemesis

Everyone keeps saying that its using IE...there's an easy way to change that...make a popupmenu on a different form, then use the RBUTTONDOWN API call, and make the popupmenu come up on that event...peace

-nemesis
(If this comment was disrespectful, please report it.)

 
1/17/2000 12:16:03 PMjammer

I filally foud the microsoft internet control so now i can make a browser in vb4 thanks for the code.
(If this comment was disrespectful, please report it.)

 
1/19/2000 6:29:32 PMErnst van Vliet

Nice, but I do have a little critizism..
I think it's fine to show the possibility of using the IE control.
I'm just bothered by the opening text stating that
you have achieved in 15 minutes something that took
the Netscape and Microsoft guys very long to do...
Fact is, the 15 minutes is made possible to you because
of the years of work done by those guys
It just doesn't sound right to me.
Maybe it's just your eye-catcher, but still..
in my opinion, you should have used something like
'creating a customized web-brouwser' as theme

I just need to get this off my chest...
(If this comment was disrespectful, please report it.)

 
2/3/2000 2:59:08 PM'lok

i know you guys love this but here is my "make a web browser in 30 seconds flat" click add form choose web browser delete any other forms change mdi child to false change startup object frmBrowser and you are done
(If this comment was disrespectful, please report it.)

 
6/29/2000 1:29:14 PMZymatic

I am having trouble getting the back anf foward buttons code to work I have tried all the examples here but it gives me a Run-Time error 424 - Object Reguired. can you help me? Thanks!

Zymatic
(If this comment was disrespectful, please report it.)

 
10/24/2000 3:29:37 PMHerb Riede

This code is functional but is getting outdated. There are MANY other WebBrowser examples on this site now, since this one was posted in 1997. There are also MULTIPLE bugs in the webbrowser control (WHICH IS IE), and despite what others have said above, YOU CAN distribute the supporting files (SHDocVw) IF you get an IE Customized Distribution license.

There is also a beta work going on elsewhere on the 'net for a Mozilla control...
(If this comment was disrespectful, please report it.)

 
1/20/2001 2:37:32 AMadam@adamz.co.uk

Will anyone send me the VBCBT.hlp file for Microsoft VB V.0 (32-Bit)
Please
For some reason it can't find it :(???
(If this comment was disrespectful, please report it.)

 
8/3/2001 10:45:33 PM§inister Ministe®

Id ask for a hint in the right direction if this isnt the best any more, but i dont know if any1 looks at this,last post on jan, now aug, if any1 has a decent browser code, (with pop up disable) could u mail me it plz plz plz
(If this comment was disrespectful, please report it.)

 
2/4/2002 1:20:05 PMBoff

Does ne1 no how to add a netscape nav browser instead of ie? ne ideas? email me @ boff74656@yahoo.com

cheerz
(If this comment was disrespectful, please report it.)

 
8/26/2003 1:00:03 AM-=TheASP=-

Took netscape months? Well if you actually wrote a browser rather than an IE front end, it would probably take you months too.
(If this comment was disrespectful, please report it.)

 
8/26/2003 10:27:38 AMIan Ippolito (RAC)

Humor is apparently lost on some people. That is exactly the point...by leveraging IE, you are saving yourself months of work.
(If this comment was disrespectful, please report it.)

 
10/19/2003 4:02:51 PMJatopian

Ooooooh, can I have a receipt for that CHECK? lol
Great point, Ian.
Probably the MS and Netscape programmers wouldn't be amused, but I say that if they give, sell, or trade you the rights to use an ActiveX control without giving them credit, then you can guiltlessly do so and call it innovation.
This post, with its comments is a veritable treasure trove of potential Web Browser code. Everyone who criticizes Ian's work should go make their own Web Browser instead of insulting his.
By the way, Ian, thanks again for creating this great website; it has helped me a lot.
-Jatopian
(If this comment was disrespectful, please report it.)

 
4/12/2004 8:57:28 AM[Wouter van Koppen]

You are using an active X control of IE. That means that you don't create a browser but use an existing program. If i add an unrar activeX to my project and i submit it and I call it unrar in vb that should be the same.
If you create a new browser in vb, then submit it and not this:S
(If this comment was disrespectful, please report it.)

 
4/15/2004 9:37:41 AMThomas Brown

I am getting error number -2147417848 (80010108)'

What is it?
(If this comment was disrespectful, please report it.)

 
8/14/2004 2:19:38 AM

how can i manage the printer setup at runtime ???

WebBrowser1.ExecWB OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER,
(If this comment was disrespectful, please report it.)

 
12/14/2004 9:25:21 PMThe ZePPeLiN

Nice , very nice..but (there is always a but) this is not a browser that user can call it's own..since it uses the same IE parsing engine..
(If this comment was disrespectful, please report it.)

 
12/4/2006 2:51:04 AMAnthony

How can i make a security form, with a server connection and uploading this system.... ahh... i really need a help... thanks
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.