Dark L3g3nd
Active Member

- Joined
- Mar 9, 2010
- Sythe Gold
- 0
- Messages
- 157
Well seeing as i have helped a couple of people with this lately i thought i might make this. A web browser was one of my first applications i made.
Step 1: Requirements
Step 2: Creating The Project
Open up Microsoft Visual Studio 2008 C# Edition and select create project.
Now you should see something like this:
Choose "Windows Form Application" And then name it Web Browser or whatever, then click Ok.
Step 3: Creating The GUI Side Of The Browser
Now you should see something like this:
Make it a bit bigger so it should now look like this:
Now go into your Tool Box and Drag five buttons and a Text Box And A Label onto the GUI
Now rename the buttons to: ()=The button number you use.By Doing This:
Back(Button1), Forward(Button2), Stop(Button3), Refresh(Button4), Go(Button5), URL(Label1).
Also rename the title of your application by clicking on the top of it where the close button is etc, and then do how you did for the buttons.
Now drag them and line them up across the top and put them in this order.
It should now look like this:
Now go back to your Tool Box and drag a Web Browser Control to your GUI and expand it to all the space left.
It should now look something like this:
Step 4: Adding The Code
Ok so now we have our GUI done but if you click the buttons it won't do anything. We need to add the functions to the buttons. Let's start with the Back button.
Double click the back button.
Now in between the { and the } it brings you to add this:
This tells your web browser to go back pretty simple aye?
Now let's do the Forward button double click it and in between the { and } it brings you to add this:
This tells your web browser to go forward.
Now it's time for the Stop button so double click and in between the { and } it brings you to add this:
This Tells your web browser to Stop, easy as pie don't you think?
Now lets do the Refresh button so double click it and in between the { and } it brings you to add this:
This Tells your web browser to refresh.
Now the Go button is the one that is a bit different, so double click it and in between the { and } it brings you to add this:
This tells your web browser to go to whatever address is in the text box you added.
Your end code should look like this:
Step 5: Building Your Project
We're all done now i recommend you save and you will need to build your web browser by doing this:
Now go to where you saved it to and open the folder then go Bin>>Release>>Web Browser (or whatever you named it) and double click it.
Enjoy
Step 1: Requirements
- Microsoft Visual Studio 2008 C# Edition Download Here
- A Brain Is Always Good
Step 2: Creating The Project
Open up Microsoft Visual Studio 2008 C# Edition and select create project.
Now you should see something like this:
Choose "Windows Form Application" And then name it Web Browser or whatever, then click Ok.
Step 3: Creating The GUI Side Of The Browser
Now you should see something like this:
Make it a bit bigger so it should now look like this:
Now go into your Tool Box and Drag five buttons and a Text Box And A Label onto the GUI
Now rename the buttons to: ()=The button number you use.By Doing This:
Back(Button1), Forward(Button2), Stop(Button3), Refresh(Button4), Go(Button5), URL(Label1).
Also rename the title of your application by clicking on the top of it where the close button is etc, and then do how you did for the buttons.
Now drag them and line them up across the top and put them in this order.
Code:
[Back] [Forward] [Stop] [Refresh] {Label} (Text Box) [Go]
It should now look like this:
Now go back to your Tool Box and drag a Web Browser Control to your GUI and expand it to all the space left.
It should now look something like this:
Step 4: Adding The Code
Ok so now we have our GUI done but if you click the buttons it won't do anything. We need to add the functions to the buttons. Let's start with the Back button.
Double click the back button.
Now in between the { and the } it brings you to add this:
Code:
webBrowserControl1.GoBack();
Now let's do the Forward button double click it and in between the { and } it brings you to add this:
Code:
webBrowserControl1.GoForward();
Now it's time for the Stop button so double click and in between the { and } it brings you to add this:
Code:
webBrowserControl1.Stop();
Now lets do the Refresh button so double click it and in between the { and } it brings you to add this:
Code:
webBrowserControl1.Refresh();
Now the Go button is the one that is a bit different, so double click it and in between the { and } it brings you to add this:
Code:
webBrowserControl1.Navigate(textBox1.Text);
Your end code should look like this:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Web_Browser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.GoBack();
}
private void button2_Click(object sender, EventArgs e)
{
webBrowser1.GoForward();
}
private void button3_Click(object sender, EventArgs e)
{
webBrowser1.Stop();
}
private void button4_Click(object sender, EventArgs e)
{
webBrowser1.Refresh();
}
private void button5_Click(object sender, EventArgs e)
{
webBrowser1.Navigate(textBox1.Text);
}
}
}
Step 5: Building Your Project
We're all done now i recommend you save and you will need to build your web browser by doing this:
Now go to where you saved it to and open the folder then go Bin>>Release>>Web Browser (or whatever you named it) and double click it.
Enjoy

