htaed
Forum Addict

Creating a Web Browser in Visual Basic 6
Step 1.
Create a new project in Visual Basic 6.
Step 2.
Right click on your toolbox and click on Components.
Step 3.
Scroll down and select these two controls, then click OK.
Step 4.
You should have two new tools like this
The one that looks like earth is a Web Browser Control, and the other is a Inet control.
Step 5.
Now, put the following on your form.
Textbox Name: address
Command Button | Name: go | Caption: Go
Command Button | Name: back | Caption: Back
Command Button | Name: forward | Caption: Forward
Command Button | Name: refresh | Caption: Refresh
Command Button | Name: stop | Caption: Stop
Command Button | Name: source | Caption: View Source
Web Browser control | Name: web
Inet Control | Name: grabsource
Step 6.
Arrange them like this:
Step 7.
EDIT: on the line before every Error: put Exit Sub, EG
As the code for them, put this.
Step 8.
Okay, now we add a new form, and rename form1 to main, and our new one form2 to Sourcecode
Step 9.
Ok so double click on our new form named Sourcecode.
Add the following:
Textbox | Name: source | Multiline: Yes | Font: Times New Roman
Command Button | Name: srefresh | Caption: Refresh
Step 10.
It should look like this:
Step 11.
Then add the following code:
Step 12.
Your now finished with your webbrowser!!
Thank you for reading! =]
Step 1.
Create a new project in Visual Basic 6.
Step 2.
Right click on your toolbox and click on Components.
Step 3.
Scroll down and select these two controls, then click OK.
Step 4.
You should have two new tools like this
The one that looks like earth is a Web Browser Control, and the other is a Inet control.
Step 5.
Now, put the following on your form.
Textbox Name: address
Command Button | Name: go | Caption: Go
Command Button | Name: back | Caption: Back
Command Button | Name: forward | Caption: Forward
Command Button | Name: refresh | Caption: Refresh
Command Button | Name: stop | Caption: Stop
Command Button | Name: source | Caption: View Source
Web Browser control | Name: web
Inet Control | Name: grabsource
Step 6.
Arrange them like this:
Step 7.
EDIT: on the line before every Error: put Exit Sub, EG
Code:
On Error Goto Error:
Web.GoBack
Exit Sub
Error:
Msgbox "Couldnl't Go back",vbinformation,"Error"
End Sub
As the code for them, put this.
Step 8.
Okay, now we add a new form, and rename form1 to main, and our new one form2 to Sourcecode
Step 9.
Ok so double click on our new form named Sourcecode.
Add the following:
Textbox | Name: source | Multiline: Yes | Font: Times New Roman
Command Button | Name: srefresh | Caption: Refresh
Step 10.
It should look like this:
Step 11.
Then add the following code:
Step 12.
Your now finished with your webbrowser!!
Thank you for reading! =]

