Aim:
To perform the C# Web browser application in C# windows form.Algorithm:
Step 1: Open the visual studio 2010 and select the file menu => newproject => windows c# => windows form applications => file name =>ok.Step2: Design the form as per the Web browser application.
Step3: Add tool strip menu,menustrip and web browser tool in the first form.
Step4: Type a code for go button.
webBrowser1.Navigate(toolStripTextBox1.Text);
Step5: Type a code for refresh button.
webBrowser1.Refresh();
Step6: Type a code for back and forward button.
webBrowser1.Goback();
webBrowser1.GoForward();
Step7: Type a code for print.
webBrowser1.print();
Step8:Type a code for Exit and stop.
Application.Exit();
webBrowser1.stop();
Step9:Compile and run the program without error.
WEB BROWSER PROGRAM
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 WindowsFormsApplication1
{
publicpartialclassForm1 : Form
{
public Form1()
{
InitializeComponent();
}
privatevoidrefreshToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.Refresh();
}
privatevoidstopToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.Stop();
}
privatevoidbackToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.GoBack();
}
privatevoidforwardToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.GoForward();
}
privatevoidexitToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
privatevoidprintToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.Print();
}
privatevoid toolStripButton1_Click(object sender, EventArgs e)
{
webBrowser1.Navigate(toolStripTextBox1.Text);
}
}
}
OUTPUT:
BY
REGU RAM SV.
إرسال تعليق