Left click not working on notifyicon with contextmenustrip

389 views Asked by At

I have a tray application and I would like to open the ContextMenuStrip if I click on the tray logo. This is my code:

    private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Left)
        {
            timeBroMenu.Show(Cursor.Position);
        }
    }

Double click is working easily.

   private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        timeBroMenu.Show(Cursor.Position);
    }

Is there any way to make the left click work?

1

There are 1 answers

1
Lyra On

You don't need to handle the Click event if you have assigned the NotifyIcon's ContextMenuStrip Property.