//首先,声明一个ContextMenuStrip控件,并初始化它。private ContextMenuStrip strip = new ContextMenuStrip();//1strip.Items.Add(\"item1\");//2strip.Items.Add(\"item2\"); //3//(当然2,3代码的位置需要调整)//然后,声明一个鼠标事件。listViewtcmedicineSearch.MouseClick += new MouseEventHandler(listViewtcmedicineSearchMouseClick);private void listViewtcmedicineSearchMouseClick(object sender,MouseEventArgs e){if (e.Button==MouseButtons.Right){strip.Show(listViewtcmedicineSearch, e.Location);//鼠标右键按下弹出菜单}}
就是这么简单。