开发者

NotifyIcon.BalloonTipClicked event and mouse buttons

I've got 开发者_JAVA百科a NotifyIcon that signals downloadable application updates. I want the download page to open on a Left Click on the NotifyIcon and on a Left Click on the NotifyIcon balloon (on screen for 10 seconds).

However, when I handle the BalloonTipClicked event I can't figure out if it was a Left or a Right click. Thus, while the balloon is still on screen and the user Right clicks on the icon, I get both the popup menu and the download page opening.

How do I detect the Right mouse button was used?


You could try testing the mouse state with code like this:

    private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e) {
        if ((Control.MouseButtons & MouseButtons.Right) == MouseButtons.Right)
            MessageBox.Show("Right button clicked");
    }

I cannot test it on my machine with Win7, right-clicking the balloon just dismisses it and displays the context menu of the taskbar. Which is your ultimate nemesis I'd say.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜