Sponsor

How to make Web browser using C# (ウェブブラウザを作る方法)

This video is a tutorial on "how to make Web browser  using C#". Lots of  programmer in their starting phase wants to create their own personal web browser  where they can create their own programs and setup the things and button as they wants. For those programmer, who wants to create web browser  but have no idea where to start. If you are one of those seeking the first starting point,then I must say this is the right place to start. Below, I have posted my video. watch and subscribe my channel.



My code while making my personal Web browser

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 Browser
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void GoButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(UrlTextBox.Text) ||
                UrlTextBox.Text.Equals("about:blank"))
            {
                MessageBox.Show("Enter a valid URL.");
                UrlTextBox.Focus();
                return;
            }
            OpenURLInBrowser(UrlTextBox.Text);
        }

        private void OpenURLInBrowser(string url)
        {
            if (!url.StartsWith("http://") &&
                !url.StartsWith("https://"))
            {
                url = "http://" + url;
            }
            try
            {
                webBrowser1.Navigate(new Uri(url));
            }
            catch (System.UriFormatException)
            {
                return;
            }
        }
        private void HomeButton_Click(object sender, EventArgs e)
{
    webBrowser1.GoHome();
}

private void BackButton_Click(object sender, EventArgs e)
{
    if (webBrowser1.CanGoBack)
        webBrowser1.GoBack();
}
private void NextButton_Click(object sender, EventArgs e)
{
    if (webBrowser1.CanGoForward)
        webBrowser1.GoForward();

private void RefreshButton_Click(object sender, EventArgs e)
{
    webBrowser1.Refresh();
}
private void SaveButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowSaveAsDialog();
}
private void PrintPreviewButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPrintPreviewDialog();
}
private void PrintButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPrintDialog();
}
private void PropertiesButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPropertiesDialog();
}


    
    }
}

Share on Google Plus

About Unknown

We bring you the latest breaking news that are happening around the world. For daily news, celebrity gossips, scoops, scandals, sports news, crime news and many more, don't forget us to visit ... www.satyaaawaz.com.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment