Visual Basic 2008 Tutorial
Web-Browser
Hello Guys and this time I'm going to show you how to create a simple Web-Browser using Visual Basic 2008. This is quite a fun and easy application to make if you've just started learning Visual Basic. This webbrowser will obviously navigate to any website you wish with the additional features of go back and go forward. Hope you enjoy.
1) Firstly, open up Visual Basic 2008 and create a new project, call it "Web-Browser"
When you form is loaded, stretch it out so it fills most of the window were the form is and add a button saying "Visit URL" also add a Webbrowser from the toolbox and stretch it so it fill most of your form, so your application should look like something similar to this;
2) Now create a textbox next to your button, this is where you'll be typing the URL To navigate to. Your application should look a bit like this;
3) Now, double click button 1 and type the following code,
webbrowser1.navigate(textbox1.text)
That code is pretty self-explanatory, basically when button1 is clicked webbrowser1 will navigate to the website which is being said in textbox1. Your code should look similar to this;
4) Now for step 4, we're going to add three buttons, one saying back, one saying forward and one saying Refresh, and to rename the button, click it once and go to the properties and change the text. Your application should look similar to this if done correctly;
Also change the form1 name to Web-Browser, do this by clicking were it says Form 1 on the application, going to the properties and change the text
5) Now for some coding, again, this coding is very self-explanatory.
You're going to want to double click button2 (The button which says Back) and type in the code; Webbrowser1.goback, and that simply makes the WebBrowser go back. And double click button3 (Forward) and type WebBrowser1.goforward, this makes the WebBrowser go forward..And you probably guessed it, double click button4 (Refresh) and type the code, WebBrowser1.Refresh and this basically refreshes the WebBrowser when clicked.
Your code should look similar to this;
Now Debug your application and test it out.
Try visiting

Hopefully, you've tried going back and forth and you may notice that the url text doesn't change, well we're going to fix this by;
Click your WebBrowser once and to the right of your screen where the properties are, you should see like a lightning icon which is called events, click that and were it says navigated double click the blank textbox which is show beside it, type in the following code;
TextBox1.Text = WebBrowser1.Url.ToString
Thank you for reading my second Visual Basic 2008 tutorial, any questions PM or leave a post and if this helped you in any way or you thought it was a good tutorial, please Thanks me
CREDITS MONDRAGON-Scotehh







