SoFunction
Updated on 2025-03-07

c# Implementation method of double-clicking on the tray does not trigger the click event


int click = 1;
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) //Double-click the tray to pop up
{
timer_singleclick.Enabled = false;
Operate_DoubleClick();
}
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e) //Click the tray to pop up
{
if ( == ) 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()
{
//This is the operation code for double-clicking
}
private void Operate_Click()
{
//This is the operation code for clicking
}