Get Mouse State without access to MouseEventArgs?

后端 未结 2 1767
旧巷少年郎
旧巷少年郎 2021-01-17 10:21

I have a form with many, many controls. I need to detect if the mouse is down or if it\'s up. Most of the time, I don\'t have MouseEventArgs.

Is the

2条回答
  •  爱一瞬间的悲伤
    2021-01-17 10:50

    You can try checking with a timer:

    private void timer1_Tick(object sender, EventArgs e) {
      this.Text = "Mouse Is " + (Control.MouseButtons == MouseButtons.Left);
    }
    

提交回复
热议问题