【winfrom-右击快捷菜单】右击或左击时显示快捷菜单
拖个contextMenuStrip控件
按钮的MouseDown事件:
private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)//此处为右击
{
contextMenuStrip1.Show(this, new Point(e.X, e.Y));
}
}