0

Is there a way to close balloon tip programmatically, so that the user does not have to click on it?
Lets imagine that the situation changes and there is no reason to show that tip anymore, showing it longer until the timeout expires would just be noise...

I tried

icon.BalloonTipText = "";
icon.BalloonTipTitle = "";
icon.ShowBalloonTip(0);

but that resulted in ArgumentException "Balloon tip text must have a non-empty value".

I would prefer a C# answer, but C++ does too.

4

1 回答 1

4

有一种很糟糕的方法,我以前做过。您不需要将文本设置为空。

只需隐藏图标并将其显示回来。可能听起来很难看,但工作完成..

private void HideBalloonTooltip()
{
    if (notifyIcon.Visible)
    {
        notifyIcon.Visible = false;
        notifyIcon.Visible = true;
    }
}
于 2013-11-28T18:26:14.817 回答