I have used Windows Forms to develop this application. The Browser control is used to display Web pages and class is Web Browser.
Code of form1.cs
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 WebBrowser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
webBrowser1.Navigate(comboBox1.Text.ToString());
}
private void navigationToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void backToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.GoBack();
}
private void nextToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.GoForward();
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string path = comboBox1.Text.ToString();
webBrowser1.Navigate(path);
comboBox1.Items.Add(comboBox1.Text.ToString());
}
private void homeToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.Navigate("http://172.19.2.250/lpuums");
comboBox1.Text = "http://172.19.2.250/lpuums";
}
private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WebBrowser
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Post a Comment