Programming: Making a WebBrowser in VB 2005 EE
Posted: Wed Jan 25, 2006 10:12 am
Start of by making a new project. Size the form to what eversize you want. Now In the tool box locate the menu strip tool and drag it onto the form it should automaticly go to the top and that fine now right click on the menu strip and select insert standard items just so it doesnt look empty. Now drag out the Tool box tool onto the form it should automaticly go under the menu strip, Now drag and status strip onto the form,
This is what you should have so far:

Now locate the WebBrowser tool in the toolbox and drag it onto the form i prefer to dock it to the parent but thats your choice. Now on the Toolstrip add Five buttons now add a drop down bar on the toolstrip then another button after it now click the combo box and go to properties and near the button change the width to how you want it. Now one more thing before we get coding click on the first button in the properties window select Display style and set it to text and now change the text of the button to Back now do this for the rest of the buttons so they say Back Foward Home Refresh Cancel and Go
Now to get coding.
Double Click your Go Button
and add this code in this is the main code that is needed to make the webbrowser work
Now for your
Back
Foward
Home
Refresh
Cancel
well that is it have fun
This is what you should have so far:

Now locate the WebBrowser tool in the toolbox and drag it onto the form i prefer to dock it to the parent but thats your choice. Now on the Toolstrip add Five buttons now add a drop down bar on the toolstrip then another button after it now click the combo box and go to properties and near the button change the width to how you want it. Now one more thing before we get coding click on the first button in the properties window select Display style and set it to text and now change the text of the button to Back now do this for the rest of the buttons so they say Back Foward Home Refresh Cancel and Go
Now to get coding.
Double Click your Go Button
and add this code in this is the main code that is needed to make the webbrowser work
Code: Select all
WebBrowser1.Navigate(ToolStripComboBox1.Text)
Back
Code: Select all
WebBrowser1.GoBack()
Code: Select all
WebBrowser1.GoFoward()
Code: Select all
WebBrowser1.GoHome()
Code: Select all
WebBrowser1.Refresh()
Code: Select all
WebBrowser1.Stop()