C# NotifyIcon behaviour on Windows 7 with MouseClick, MouseDoubleClick events

Posted by binball on Stack Overflow See other posts from Stack Overflow or by binball
Published on 2010-03-23T09:45:13Z Indexed on 2010/06/16 2:32 UTC
Read the original article Hit count: 300

Filed under:
|

Hi,

I have strange behaviour with my app after run it on Windows 7. It's connected with NotifyIcon while app is minimized.

What should happens:

1) Click once on icon with mouse left button then Balloon with some text should appears

2) Double click on icon will show again app window

On Windows 7 MouseDoubleClick is also fired but window is not showing. I don't know why. The same code works good on Windows XP.

private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Left)
    {
        this.NotifyIconShowBalloonWithData();
    }
}

private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
{
    this.Show();
    WindowState = FormWindowState.Normal;
    notifyIcon.Visible = false;
}

What did I wrong? :)

Thanks in advance for your answer.

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms