Issue with NotifyIcon not disappearing on Winforms App

前端 未结 7 1800
暗喜
暗喜 2020-12-16 17:38

I\'ve got a .Net 3.5 C# Winforms app. It\'s got no GUI as such, just a NotifyIcon with a ContextMenu.

I\'ve tried to set the NotifyIcon to visible=false and dispose

相关标签:
7条回答
  • 2020-12-16 18:05

    Sometimes Application_Exit event can be raised several times Just put notifyIcon = null; in the end

    if (notifyIcon != null)
    {
        notifyIcon.Visible = false;
        notifyIcon.Dispose();
        notifyIcon = null;
    }
    
    0 讨论(0)
提交回复
热议问题