处理一个点击了与任务栏图标的ShowBalloonTip显示气球提示()气球、任务栏、图标、提示

2023-09-03 01:28:46 作者:终是深情辜负

我用任务栏图标类的 ShowBalloonTip 方法来显示一个气球提示。有没有一种方法来处理点击了这个气球?

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 click over the balloon, no event seem to be generated, and it only closes the balloon.

推荐答案

我想你的意思的 NotifyIcon的。使用以下模式...

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...