判断鼠标是否按下.
判断鼠标是否按下.
[解决办法]
mouse.mousedown()
[解决办法]
You may use Control.MouseButtons to detect mouse button status.
- C# code
public partial class Form1 : Form { Timer timer = new Timer(); public Form1() { InitializeComponent(); timer.Interval = 100; timer.Start(); timer.Tick += delegate { string s = ""; switch (Control.MouseButtons) { case MouseButtons.Left: s = "Left"; break; case MouseButtons.Middle: s = "Middle"; break; case MouseButtons.Right: s = "Right"; break; } this.Text = s; }; } }
[解决办法]
if (MouseButtons == MouseButtons.Left)
MessageBox.Show("mouse left click ");