Professional Documents
Culture Documents
o Bước 2: lần lược thêm 2 menu gồm: tên menu, hình ảnh tượng trưng cho menu và sự kiện xử
lý khi nhấn vào 2 menu.
Trong đó:
this.ContextMenuStrip = cms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MyProject
{
public partial class FormManuContext : Form
{
public FormManuContext()
{
InitializeComponent();
this.Load += new EventHandler(FormManuContext_Load);
}
this.ContextMenuStrip = cms;
// Hàm này sẽ được thực thi khi bạn nhấn vào "Góc kinh nghiệm"
void Gockinhnghiem_click(object sender, EventArgs e)
{
MessageBox.Show("Bạn vừa nhấn vào \"Góc Kinh Nghiệm\"!");
}
// Hàm này sẽ được thực thi khi bạn nhấn vào "Chrome"
void Chrome_click(object sender, EventArgs e)
{
MessageBox.Show("Bạn vừa nhấn vào \"Chrome\"!");
}
}
}