4
我以相當簡單的方式使用NotifyIcon。C#NofityIcon氣球提示並不總是在指定時間內消失
public class Popup
{
...
private static NotifyIcon ni;
static Popup()
{
ni = new NotifyIcon();
ni.Icon = SystemIcons.Information;
}
public Popup(string nexusKey)
{
...
}
public void make(string text)
{
try
{
...
}
catch
{
ni.Visible = true;
ni.ShowBalloonTip(1000, "Thats the title", text, ToolTipIcon.Info);
}
}
}
問題是,它似乎像「活着」計時器如果我專注不同的窗口比一個託管顯示氣球過程中不上手。無論如何,1秒後如何確保氣球消失的任何想法?
謝謝Chirs,這是所期望的效果。但是,我的應用程序在幾次泡泡後變得不穩定。也許因爲這畢竟是同步的? – Jerome
嘗試在使用委託或方法使用Invoke更改圖標可見性的工作線程中運行計時器。 – ChrisBD
對於Windows 7似乎是正確的(氣球提示一直保留到用戶輸入爲止),但不適用於Windows 10,所以我想這也是操作系統特定的。 –