How to create a basic web browser in Visual Studio 2015

TESTED WITH VISUAL STUDIO COMMUNITY 2015. SHOULD WORK WITH OLDER AND NEWER VERSIONS BUT NOT GUARANTEED.

Here is how to create a simple web browser with Visual Studio. This example covers the basics of the WebBrowser tool in Visual Studio and how it works. The web browser example contains only the basic components of a web browser: an address bar and a button that tells the program to load the URL entered into the address bar.

First, fire up Visual Studio and click Create New Project. Choose Windows Form Application. Call the application what you want your web browser to be called. As this is not SeaSurf or WebNet, I am calling it WebBrowserExample but you can call it what ever you like.

winformbrowser

Click OK and the project should load.

You should see the designer for the project. Resize the window shown in the design.

screenshot-5

screenshot-6

Click on the properties of Form1, and change the text to what you want the title of your window to be.

Then click on Toolbox and drag in a Button and a TextBox.

Then drag in a WebBrowser.

screenshot-7

Now double click on the GO! button (or whatever you renamed it to in properties) and you should see the application’s code.

Here is the code for the GO! button:

string Webpage = textBox1.Text.Trim();
webBrowser1.Navigate(Webpage);

Save and run the web browser. Build “yourappname.exe” to be able to share it online!

screenshot-8

Hope you like it! I may post future tutorials about adding Back and Forward buttons.

Epic Chas Gamer πŸ˜€

9 thoughts on “How to create a basic web browser in Visual Studio 2015

Go on, you know you want to! Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s