Create a web browser in your app!
I found this information here on VB-World somewhere!
Hope this Helps!
Flint
Creating a simple web browser
Now you will learn how to create a simple browser with one line of code! Launch Visual Basic and select "Custom Controls" from the "Tools" menu. Check "Microsoft Internet Controls" and click OK. Two icons will appear on the toolbox (If you can't see the toolbox, go to the "View" menu and click "Toolbox").
Now, click the world image on the toolbar and then draw out the control onto the form. You have now added the WebBrowser control to your project.
Now you just need to direct the browser to a certain site. Select the form and click F7 to open up the code window. In the Form_Load event, type in the following code:
Code:
WebBrowser1.Navigate "http://visualbasic.about.com"
Now, run the project by pressing F5 or the Run button on the ToolBar. With luck, the WebBrowser control will connect to the About.com server and download the Visual Basic home page (you may be prompted to dial into your service provider).
You have just created a working WebBrowser with one line of code! The next part of this feature will show you how to add a drop-down list to allow the user to select a past address to visit, or type in a new address.
Adding an Address Box
One of the most essential features of your web browser is a box where you can type in the address of a web site to visit. Most modern browsers now feature a drop-down list of past web sites as well.
First, add a combo box to the form as shown in Figure 2. This box will contain the list of past sites that you have visited.
Now you can add the code to the Combo1.Click event that will allow the user to select a site from the drop down list to visit.
Code:
Private Sub Combo1_Click()
WebBrowser1.Navigate (Combo1.Text)
End Sub
Remember that the user may also type in the address of a web site to visit, and then press the enter key to go to the site. In order to make the Combo box redirect the WebBrowser control to the site when the user clicks the enter key, use the KeyPress event to detect the KeyAscii code of 13, which is the ASCII code for the enter key.
Code:
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1_Click
End If
End Sub
Finally, you have to add the code the actually adds items into the drop down list. When the WebBrowser control visits a site, it triggers the BeforeNavigate event. [B]You can place code in this event to add the site into the Combo box.
Code:
Private Sub WebBrowser1_BeforeNavigate(ByVal URL As String, _
ByVal Flags As Long, ByVal TargetFrameName As String, _
PostData As Variant, ByVal Headers As String, Cancel As _
Boolean)
Dim strURL As String
strURL = URL
Dim bFound As Boolean
Dim i As Integer
For i = 0 To Combo1.ListCount - 1
If Combo1.List(i) = strURL Then
bFound = True
Exit For
End If
Next i
If Not bFound Then
Combo1.AddItem strURL
End If
Combo1.Text = strURL
End Sub
Adding Back and Forward Navigation Buttons
Finally, your browser needs to offer a way for users to go back and forward between pages. Fortunately, the WebBrowser control offers two procedures that you can use:
GoBack
GoForward
Add two command buttons to the form
Code:
'In the Command1 Click event, add the following code:
On Error Resume Next
WebBrowser1.GoBack
'In the Command2 Click event, add the following code:
On Error Resume Next
WebBrowser1.GoForward
Now run the program! You will now be able to use the application as a fully working web browser, and use the two command buttons to navigate between pages you have already seen.