具体实现代码见下:
代码如下:
int click = 1;
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) //双击托盘弹出
{
timer_singleclick.Enabled = false;
Operate_DoubleClick();
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) //单击托盘弹出
{
if (e.Button == MouseButtons.Left) timer_singleclick.Enabled = true;
}
private void timer_singleclick_Tick(object sender, EventArgs e)
{
click = click + 1;
if (click == 5)
{
Operate_Click();
timer_singleclick.Enabled = false;
click = 1;
}
}
private void Operate_DoubleClick()
{
//这里为双击的操作代码
}
private void Operate_Click()
{
//这里为单击的操作代码
}