Post by ~Joedagimp on Dec 26, 2008 15:56:54 GMT -5
This is the basics of making a Web Browser using Visual Basic.
In this tutorial I hope to:
- Show you how to create a simple web browser.
- Show you what the code means
The program I am using is Microsoft Visual Basic 2008 Express Edition.
This is a free download, so check them out on the Microsoft Developers Network.
So lets start off:
Make a new windows form application in a new project.
Form1 should come up.
Add a WebBrowser, Button and Textbox.
Move them around to look appropriate.
( What I done was add a panel, and stretch it across the top of the form and include the textbox and button inside. Change the "Dock" to top ).
Change the button1 name to "Go" or "Answer" etc... by clicking on Button1 and changing the Name property in the properties box. ( If you cannot find the properties box, go to View - Properties Box ).
Now stretch out the WebBrowser, and Dock it to the center.
Now:
Double Click the Button.
The code that we put for the web browser to work is:
WebBrowser1 - The webbrowser. As its the first web browser you have used in the form, it will be called WebBrowser1.
.Navigate - This tells the Web Browser to Navigate. You need the full stop in between them to work, because they work together.
=TextBox1.text - This is the final part. the =TextBox1.text means the text in TextBox1, which is the only text box you have made, so it will have the number 1 included. The = is needed because the whole code would then basically mean:
WebBrowser1 navigates from the text in Textbox1.
So now, if you typed in
www.joedagimp.co.nr
in the TextBox1 and pressed the button, it would then navigate from the TextBox1 Text ( which is www.joedagimp.co.nr ) and will therefore load up the site!
So there we have it. The basics of a web browser!
After this, you can add some more advanced coding to generate and progress bar, links, refresh, back, forward, home, google search, and media centers.
Check out my first browser video to show you what it can look like:
uk.youtube.com/watch?v=Vsf877jTp3k
In this tutorial I hope to:
- Show you how to create a simple web browser.
- Show you what the code means
The program I am using is Microsoft Visual Basic 2008 Express Edition.
This is a free download, so check them out on the Microsoft Developers Network.
So lets start off:
Make a new windows form application in a new project.
Form1 should come up.
Add a WebBrowser, Button and Textbox.
Move them around to look appropriate.
( What I done was add a panel, and stretch it across the top of the form and include the textbox and button inside. Change the "Dock" to top ).
Change the button1 name to "Go" or "Answer" etc... by clicking on Button1 and changing the Name property in the properties box. ( If you cannot find the properties box, go to View - Properties Box ).
Now stretch out the WebBrowser, and Dock it to the center.
Now:
Double Click the Button.
The code that we put for the web browser to work is:
WebBrowser1.Navigate=Textbox1.text
WebBrowser1 - The webbrowser. As its the first web browser you have used in the form, it will be called WebBrowser1.
.Navigate - This tells the Web Browser to Navigate. You need the full stop in between them to work, because they work together.
=TextBox1.text - This is the final part. the =TextBox1.text means the text in TextBox1, which is the only text box you have made, so it will have the number 1 included. The = is needed because the whole code would then basically mean:
WebBrowser1 navigates from the text in Textbox1.
So now, if you typed in
www.joedagimp.co.nr
in the TextBox1 and pressed the button, it would then navigate from the TextBox1 Text ( which is www.joedagimp.co.nr ) and will therefore load up the site!
So there we have it. The basics of a web browser!
After this, you can add some more advanced coding to generate and progress bar, links, refresh, back, forward, home, google search, and media centers.
Check out my first browser video to show you what it can look like:
uk.youtube.com/watch?v=Vsf877jTp3k