Handling a click over a balloon tip displayed with TrayIcon's ShowBalloonTip()

后端 未结 2 494
囚心锁ツ
囚心锁ツ 2020-12-20 15:37

I use the ShowBalloonTip method of a TrayIcon class to display a balloon tip. Is there a way to handle a click over this balloon?

When I cl

2条回答
  •  执笔经年
    2020-12-20 16:14

    I think you mean NotifyIcon . Use following pattern...

    NotifyIcon notifyIcon = null;
    public Form1()
    {
        InitializeComponent();
        notifyIcon = new NotifyIcon();
        // Initializing notifyIcon here...
        notifyIcon.BalloonTipClicked += new EventHandler(notifyIcon_BalloonTipClicked);
    }
    
    void notifyIcon_BalloonTipClicked(object sender, EventArgs e)
    {
        // Operation you want...
    }
    

    I hope it feed your needs...

提交回复
热议问题