How to Make a Free Web Browser

How to Make a Free Web Browser thumbnail
A browser is nothing more than a form that displays information from the Web.

Impress your friends by emailing them your own personal browser. The technology required to move data and images across the Internet is complex. Microsoft's Visual Studio application hides the complexity of the Web and builds most of the browser code for you. All you need is a free trial version of Visual Studio and the ability to type a few lines of text.

Instructions

  1. Install Visual Studio

    • 1

      Proceed to the next section if you have Microsoft Visual Studio installed.

    • 2

      Visit the Microsoft Visual Studio download site and click "Download." Click "Save" when the save window appears. The site will download the installation file to your hard drive.

    • 3

      Double-click the downloaded file. A wizard will open and guide you through the installation process.

    Create Browser Layout

    • 4

      Click the Windows "Start" menu button and type "Visual Studio." Click "Visual Studio" when it appears in the search results list at the top of the Start menu. The application will open.

    • 5

      Click "File" and select "New Project" to open the "New Project" window. Click "Visual C#" and then click "Windows Form Application" to highlight it.

    • 6

      Type "My Browser" (without the quotes) in the "Solution Name" text box and click "OK." Project files will appear on the right side of the screen in the "Solution Navigator" window. An empty form will appear to the left in the "Design" window.

    • 7

      Left-click the bottom right corner of the form and drag it to make it about three times its original size. The size you set will determine how your Web browser appears when it opens.

    • 8

      Click "View" and select "Toolbox." A toolbox will open. Double-click the "WebBrowser" control to add it to the form. Left-click the WebBrower's lower right edge, hold down your left mouse button and drag the control to make it bigger. Resize the control so that it fills 75 percent of the form.

    • 9

      Click inside the WebBrowser control, hold down your left mouse button and drag the control to the bottom of the form. This will leave an empty area at the top of the form. This is where you will place buttons and other controls.

    • 10

      Return to the toolbox and double-click the "Button" control three times. Three buttons named "Button1, "Button2" and "Button3" will appear on the form.

    • 11

      Locate the "Textbox" control in the toolbox and double-click it to add it to the form. Click its right edge, hold down your left mouse button and drag to the right to make the text box wider. Make its width 50 percent of the form's width.

    • 12

      Click and drag the text box to the top right edge of the form. This text box will become the browser's address bar where users will type URLs.

    • 13

      Click and drag "Button 3" to the top left edge of the form. Then, click and drag "Button 2" to the left edge of the form.

    Customize Controls

    • 14

      Click and drag the text box to the top of the form. Double-click "Button3." The "Code" window will open and display the following code: private void button3_Click(object sender, EventArgs e) { } The code consists of text followed by a left bracket and a right bracket at the bottom of the code block.

    • 15

      Paste the following text before the bottom right bracket: webBrowser1.GoBack();

    • 16

      Double-click "Button2." The "Code" window and display its code block similar to the code block for "Button3." Paste the following line before the bottom right bracket: webBrowser1.GoForward();

    • 17

      Double-click "Button1" to display its code block. Paste the following code before that code's bottom right bracket: webBrowser1.Navigate(textBox1.Text);

    • 18

      Press "F5" to run the project. The form will open and display the controls. Type a URL in the text box and click "Button3." The website that you enter will appear in the browser.

    • 19

      Double-click any link on the Web page and the browser will navigate to that link's page.

    • 20

      Click "Button1." The browser will take you back to the previous page. Click "Button2" to go to the next page. Buttons one and two function as "Forward" and "Back" buttons.

    • 21

      Press "Shift+F5" to stop the project and return to the "Code" window. Locate this line of code at the top of the window: InitializeComponent();

    • 22

      Add the following code below that line: button1.Text = "Go"; button2.Text = "Forward >>"; button3.Text = "<< Back"; button3.Text = "xyz"; Replace "xyz" with any word. That word will appear in the browser's title bar.

    • 23

      Press "F5" again to view the browser. The buttons and title bar will display the new names.

Tips & Warnings

  • As you work in Visual Studio, press "CTRL+Z" to undo changes if you make a mistake. Drag, resize and move controls to create a layout that you like.

  • This browser does not have the logic needed to recognize short URL names. "Google.com" is a short URL name. The long version is "http://www.google.com." When using your browser, enter long URL names.

Related Searches:

References

Resources

  • Photo Credit internet image by Jean-Michel POUGET from Fotolia.com

Comments

You May Also Like

Related Ads

Featured