When I found the codes for a Web Browser on the Internet and
through MSDN help files I was just getting my Cable Modem installed, but I
remember what it was like to surf the Internet through 56k on my 75mhz machine.
Internet Explorer hogged the hell out of my memory and slowed my PC down
that even if I had a Cable Modem it wouldn't matter. I wanted to make my
own Browser that wouldn't have a million functions and 3D graphics to just to
surf the web. I wanted to keep it simple. I was very proud and I
created my own Zeta Explorer, but after looking at other creations and realizing
that it had only been more like an Internet Explorer with a new skin I sorta
gave up on making any newer ones. Sure I had a nice MDI one but I didn't
keep the code and forgot about it. Anyways heres the basics.
First add a control called "Microsoft Internet Controls."
To get this right click on the toolbar and select "Components..." then
scroll down and check "Microsoft Internet Controls."
Then draw a
webbrowser object on the form. You can resize to what ever you like but
you'll probablly want it to be almost as the big as the form.
Lets do
something simple to get an ideal how this works. Add the following code to
the Form_Load.
Private Sub
Form_Load()
WebBrowser1.Navigate
"www.vbx23.cjb.net"
End SubThis will tell the webbrowser to
load my webpage. You can use any url you want.
Going farther.
You'll probablly want to be able to change the url that it goes
to at run time instead of having to edit code just to go to another
website.
Add a textbox (or combobox) and a button.
Set the
following:
Add the following code to the
Command1_Click:
Private Sub
Command1_Click()
WebBrowser1.Navigate Combo1.Text
End
SubThis will tell the Browser to goto what ever is typed into the
Combo field.
Don't Stop their, you need Back, Forward, Stop and Refresh
buttons.
Add and set the following:
cmbBack
|
Catpion
|
Back
|
cmbFwd
|
Caption
|
Forward
|
cmbStop
|
Caption
|
Stop
|
cmbRef
|
Caption
|
Refresh
|
Add the following codes
corresponding to the buttons.
Private Sub
cmbBack_Click()
WebBrowser1.GoBack
End
Sub
Private Sub cmbFwd_Click()
WebBrowser1.GoForward
End Sub
Private Sub
cmbRef_Click()
WebBrowser1.Refresh
End
Sub
Private Sub cmbStop_Click()
WebBrowser1.Stop
End SubSimple? Now you have a
Webbrowser that won't use 20mb of memory to run. But your going to want
more right? If so I'll be adding some codes for a webbrowser to help you
out.
If you have any problems e-mail me at
Vbx23@nc.rr.com
If you have any
broken links e-mail me at Vbx23@nc.rr.com