【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));
  }
}

posted @ 2016-07-22 11:35  发明创造小能手  阅读(265)  评论(0编辑  收藏  举报
levels of contents