asked on
////////////////////mouse.cs//////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace Class_Calculator
{
class mouse : Form
{
ContextMenuStrip mnu;
ToolStripMenuItem mnuSwitch;
ToolStripMenuItem mnuWire;
ToolStripMenuItem mnuRelay;
public mouse()
{
this.mnu = new ContextMenuStrip();
this.mnuSwitch = new ToolStripMenuItem("Switch");
this.mnuWire = new ToolStripMenuItem("Wire");
this.mnuRelay = new ToolStripMenuItem("Relay");
mnuSwitch.Image = Image.FromFile(@"E:\C#\Uthaya Project\ico\ico\Switch.ico");
mnuWire.Image = Image.FromFile(@"E:\C#\Uthaya Project\ico\ico\Wire.ico");
mnuRelay.Image = Image.FromFile(@"E:\C#\Uthaya Project\ico\ico\Relay.ico");
mnu.Items.AddRange(new ToolStripItem[] { mnuSwitch, mnuWire, mnuRelay });
}
}
}
///////////////////////Form1///////////////////////////////
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 Class_Calculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.ContextMenuStrip = mnu;
}
}
}