Jump to content
xisto Community
Sign in to follow this  
William Wood

Making A Web Browser With Visual Basic 6

Recommended Posts

Hi everyone!

I'm going to tell you how to make a very simple web browser with Microsoft Visual Basic 6.0. Its basically a customized version of Internet Explorer, though, so enjoy!

 

First of all, you need to start a new project, make a Standard EXE. Then click on the Project menu and select Components. Check Microsoft Internet Controls and click Apply.

From the Insert menu, click on the icon that has just appeared.

Drag it onto the program layout, but make sure you make the program big enough and leave a space at the top for all the web buttons.

 

Make a text box and drag it where you want it to go. Now make four command buttons which will be GO, REFRESH, BACK and FORWARD. Then name each of them Cmdback (BACK), CmdForward (FORWARD), CmdGo (GO), and CmdRefresh (REFRESH).

 

Now here is where you put in the codes.

 

On the BACK button, insert this code

----------------------------------------------------

Private Sub cmdback_Click()

WebBrowser1.GoBack

End Sub

----------------------------------------------------

This tells the browser to go Back.

On the FORWARD button, insert this code.

----------------------------------------------------

Private Sub Cmdforward_Click()

WebBrowser1.GoForward

End Sub

----------------------------------------------------

This tells the browser to go Forward.

On the GO button, insert this code.

----------------------------------------------------

Private Sub cmdgo_Click()

WebBrowser1.Navigate (Text1.Text)

End Sub

----------------------------------------------------

This tells the web browser to go to the page you want it to.

On the REFRESH button, insert this code.

----------------------------------------------------

Private Sub cmdrefresh_Click()

WebBrowser1.Refresh

End Sub

----------------------------------------------------

This tells the browser to refresh the page.

On the FORM1 insert this code.

----------------------------------------------------

Private Sub Form_Load()

WebBrowser1.Navigate ("https://www.google.de/?gfe_rd=cr&ei=BwkjVKfAD8uH8QfckIGgCQ&gws_rd=ssl;)

End Sub

----------------------------------------------------

This makes your homepage, simply change https://www.google.de/?gfe_rd=cr&ei=BwkjVKfAD8uH8QfckIGgCQ&gws_rd=ssl to the page you want, if otherwise.

On the WEBBROWSER1 insert this code.

----------------------------------------------------

Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)

Text1.Text = (WebBrowser1.LocationURL)

Form1.Caption = (WebBrowser1.LocationName)

End Sub

----------------------------------------------------

It makes the URL name the header, and changes the address to the place you wish to go.

Thats all! Save your project, and enjoy your customized web browser! :blink:

Share this post


Link to post
Share on other sites

i would try it if only i had visual basici have another program called browser bob which makes customized browsers based on internet explorerits basically internet explorer but with your own look, u can make your own buttons, pictures, borders and boxes, stuff like that

Share this post


Link to post
Share on other sites

If memory serves me right (and its been a long time), in VB6 there was a Web Browser template that could be used! It put in the browser control, status bars, menus etc etc. Which was good if you were adding simple browsers to your project!I must say that I prefer the new browser control in VB.NET! It has many more options then the VB6 one did! Sten, if you want to try out VB, have a look at the Visual Studio Express Editions (search on this board, theres heaps of topics!). You can have a go of any of the .NET languages for free!

Share this post


Link to post
Share on other sites
Using Sendkeys statment with your webbrowserMaking A Web Browser With Visual Basic 6PLease, your mithod is very good idea ,But if you please, send me How can I use the sendkeys statment with this webbrowser to can make some orders .E.X : send {TAB} for 30 times Or press "^(F)" and reaching to a specific place in this webbrowser to can write a specific text on it .Please, this is too important and neccessary for me .-reply by abd El-ghany

 

Share this post


Link to post
Share on other sites
CarefulMaking A Web Browser With Visual Basic 6

you need to be really careful when using your custom made browser as it hasno protection but is a great way to learn to program. Try not to copy and paste things typing ensures you learn it. Thanks though the tut was great!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.