04-09-2010, 12:25 PM
(This post was last modified: 04-12-2010, 04:37 PM by hockeynut35.)
Create a Web browser with VB
Materials :
1 Toolstrip + ToolStrip Controls, 1 WebBrowser.
1)
drag a toolstrip from the toolbox onto the form. Make sure that the Grip Visibility is set to Hidden.
2)
Time to add the controls!
Needed:
6 ToolStripButtons, 1 ToolStripLabel, and 1 ToolStripTextBox
Naming the buttons
Name the first button "Back"
Name the second button "forward"
Name the third "refresh"
Name the fourth "stop"
Name the fifth "home"
And finally name the last "GO".
The go button alignment property must be set to "right".
We can now set "DisplayStyle" to "Image".
Set the images you want for the buttons.
Now we must move on and label and the textbox on the toolstrip.
For the "Label" change the "text property" to and the name to urlLabel.
Now the textbox will be named url and the text leave empty.
3)
Next drag the WebBrowser Control onto the form.
Set the name property of the webbrowser to
4)
Now for the actual coding part.
Double-Click on the Form and enter this code:Double-Click on the Back Button and enter this code: Double-Click on the Forward Button and enter this code: Double-Click on the Refresh Button and enter this code: Double-Click on the Stop Button and enter this code: Double-Click on the Home Button and enter this code: Double-Click on the GO Button and enter this code: webBrowser.Navigate(url.Text).[/code]
Double-Click on the webBrowser and enter this code:
5) The end result
This is a very basic tutorial! Add more functions to your web browser such as tabs and history as you learn and become more advanced!
[/align]
Materials :
1 Toolstrip + ToolStrip Controls, 1 WebBrowser.
1)
drag a toolstrip from the toolbox onto the form. Make sure that the Grip Visibility is set to Hidden.
2)
Time to add the controls!
Needed:
6 ToolStripButtons, 1 ToolStripLabel, and 1 ToolStripTextBox
Naming the buttons
Name the first button "Back"
Name the second button "forward"
Name the third "refresh"
Name the fourth "stop"
Name the fifth "home"
And finally name the last "GO".
The go button alignment property must be set to "right".
We can now set "DisplayStyle" to "Image".
Set the images you want for the buttons.
Now we must move on and label and the textbox on the toolstrip.
For the "Label" change the "text property" to
Code:
URL
Now the textbox will be named url and the text leave empty.
3)
Next drag the WebBrowser Control onto the form.
Set the name property of the webbrowser to
Code:
webBrowser
4)
Now for the actual coding part.
Double-Click on the Form and enter this code:
Code:
webBrowser.GoHome().
Code:
webBrowser.GoBack().
Code:
webBrowser.GoForward().
Code:
webBrowser.Refresh().
Code:
webBrowser.Stop().
Code:
webBrowser.GoHome().
Double-Click on the webBrowser and enter this code:
Code:
url.Text = e.Url.ToString().
5) The end result
This is a very basic tutorial! Add more functions to your web browser such as tabs and history as you learn and become more advanced!
[/align]
Pm me if you need assistance with anything.