Exclusively for you!! Trial version of Google Apps, Apply Coupon-CNHPGX6T6QRWGV!!
Create a browser in C# WinForms
Mar09

Create a browser in C# WinForms

Welcome to CodeSpread! Hi Guys, This is Sathish, one of my friend was finding difficult in creating his own web browser, so I thought lets create a simple web browser in win forms of c# and share it with you. We are only going to use buttons, labels etc. in Win-forms and achieve our goal. Let’s start our recipe for the day. What is a web browser? In Simple words, it provides a way where you just have to provide the address and can view the contents of the web. Today I will show you how to create a simple web browser . First,let’s create a Menu bar in win-forms, so we can include any number of tabs when ever needed using Menu strip Option in toolbox. Then assign some functionality to it. It would look like this. private void nEWToolStripMenuItem_Click(object sender, EventArgs e) { Form1 fm = new Form1(); fm.Show(); } private void eXITToolStripMenuItem_Click(object sender, EventArgs e) { Application.Exit(); } After creating a menu strip in the background, where I have added two menu items New and Exit, New for creating a new browser window, And, Exit for exiting the browser. We will add few more items like we have to create a address bar using ComboBox,Go button,Back,Forward and web browser to the window. Note: I am Using Combo box over here, it is required to alter the collections of combo box to the specified Url,you can also try with Textbox also. So let’s start coding for web browser in Search Button. here I am just navigating to the url specified in the combo box. Search Button : private void SEARCH_Click(object sender, EventArgs e) { webBrowser1.Navigate(new Uri(comboBox1.SelectedItem.ToString())) ; } Here make sure combo box values is converted to string. Back Button : private void BACK_Click(object sender, EventArgs e) { webBrowser1.GoBack(); } Forward Button : private void FORWARD_Click(object sender, EventArgs e) { webBrowser1.GoForward(); } It will look somewhat Like this on Completion. Now let’s run the programming, It will look like this. It’s Simple right; you can download the source code from https://www.box.com/files/0/f/723677963/1/f_6786628265. Please write your valuable queries over here or send it to admin@codespread.com,sSo that I can improve and add more value to my...

Read More