1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
private MouseButtons Button;
private long Ticks;
private long TicksDelay = 100000L;
private void btn_Click(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (DateTime.Now.Ticks - Ticks < TicksDelay && Button == MouseButtons.Right)
{
//左右键"同时"(先左后右)
}
else
{
//左键
}
}
else if (e.Button == MouseButtons.Right)
{
if (DateTime.Now.Ticks - Ticks < TicksDelay && Button == MouseButtons.Left)
{
//左右键"同时"(先右后左)
}
else
{
//右键
}
}
Button = e.Button;
Ticks = DateTime.Now.Ticks;
}