using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace EnjoinRMKeyInTXT { public partial class Frm_Main : Form { public Frm_Main() { InitializeComponent(); }
private void textBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right)//如果按下鼠标右键 { textBox1.ContextMenu = new ContextMenu();//初始化右键菜单 } } } }