如何检测是否双击通知图标

时间:2017-01-27 18:27:31

标签: c#

如何检测通知图标是否双击

private NotifyIcon NotifyIcon;
NotifyIcon = new NotifyIcon();
NotifyIcon.Text = "FCleaner";
NotifyIcon.Icon = new Icon(SystemIcons.Application, 40, 40);
NotifyIcon.ContextMenu = cmsNotifyicon;
NotifyIcon.Visible = true;

如果双击通知图标,如何调用此方法?      private void NotifyIcon_MouseDoubleClick(object sender,MouseEventArgs e)

1 个答案:

答案 0 :(得分:0)

您需要订阅该活动,并将其附加到您的活动处理程序。

private NotifyIcon _notifyIcon;

_notifyIcon= new NotifyIcon();
_notifyIcon.Text = "FCleaner";
_notifyIcon.Icon = new Icon(SystemIcons.Application, 40, 40);
_notifyIcon.ContextMenu = cmsNotifyicon;
_notifyIcon.Visible = true;
_notifyIcon.MouseDoubleClick += NotifyIcon_MouseDoubleClick;