Library tutorials & articles
WebBrowser Control
- Introduction
- The Basics
- Going Further
- More Navigation
- Browser Commands
Going Further
However, there is much to a browser than just the browser window. You need a List box to type in the address of other websites. And you need other navigational tools such as Back and Forward Buttons.
So do you want to know how to do it, or is that it?
Now then select the combo box icon from the toolbox, and draw a combo on the form. Add a label with the caption address and place it alongside the combo box. Then go to the code windows and type the following text:
Private Sub
Combo1_Click() WebBrowser1.Navigate
Combo1.Text
End Sub
Private Sub
Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1_Click
End If
End Sub
If you did that correctly you can now navigate anywhere on the web by typing the address of the site in the combo box. Now then you can add forward and back buttons to the browser to do exactly what it says on the tin!!
Add two command buttons on the form. Call them CmdBack and CmdForward respectively.
Change the two caption to Back and Forward. Double click on the back button. Add this code to the event CmdBack_Click….
WebBrowser1.GoBack
And then double click on the Forward button and add the code to the event CmdForward…
WebBrowser1.GoForward
This is roughly what you should end up with!!! A working Web Browser with Back and Forward Buttion and a address box to type away with!! If you find the browser windows too samll just make the form bigger and then extend the browser window is you see fit. Next Time, I will go into deeper mud, showing you how to load save and print, and add an about box as well. I will also show a pitfall which happens when you resize the form and you want to resize the browser window as well...
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Comments
Leave a comment
Sign in or Join us (it's free).