c#鼠标右键单击事件怎么写

2025-03-18 03:16:46
推荐回答(2个)
回答1:

假设你窗体上有一个contextMenuStrip1菜单

 private void Form1_MouseDown(object sender, MouseEventArgs e)
 {
  //按鼠标右键,弹出菜单   
  if (e.Button == System.Windows.Forms.MouseButtons.Right)
  {
    contextMenuStrip1.Show(PointToScreen(e.Location));
  }
}

回答2:

右键是菜单啊,你要什么做什么?明确下!