[英]Multiple icons open in tray bar
我正在使用Windows應用程序,並且在運行該應用程序時,托盤欄上出現了多個圖標:
當我將鼠標懸停在這些圖標上時,它們便消失了。
有人知道為什么會這樣嗎?
protected override void OnClosed(EventArgs e)
{
try
{
notifyIcon1.Visible = false;
notifyIcon1.Icon.Dispose();
notifyIcon1.Dispose();
}
catch(Exception ex)
{
}
base.OnClosed(e);
Environment.Exit(0);
}
這是我關閉系統任務欄圖標以在我之前編寫的程序中顯示完整應用程序的方式:
注意:這很適合后面代碼中的事件處理程序,因此this.Show()和this.Activate()
NotifyIcon sysTrayIcon = sender as NotifyIcon;
sysTrayIcon.Visible = false;
this.WindowState = WindowState.Normal;
this.Show();
this.Activate();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.