在C#的窗体程序中,获得鼠标点击的事件时,想要得知当前是否有Control键,Shift键等是否被按下。

 

 1 private void xxx_MouseClick(object sender, MouseEventArgs e)
 2 {
 3     if ((Control.ModifierKeys & Keys.Control) == Keys.Control)// CTRL is pressed
 4     {
 5  
 6     }
 7      
 8     if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
 9     {
10      
11     }
12 }

 

相关文章:

  • 2021-12-16
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案