NotifyIcon remains in Tray even after application closing but disappears on Mouse Hover

后端 未结 14 1353
清歌不尽
清歌不尽 2020-12-03 00:08

There are many questions on SO asking same doubt. Solution for this is to set

notifyIcon.icon = null and calling Dispose for it in FormClo

14条回答
  •  臣服心动
    2020-12-03 00:53

    The only way that works to me was:

    1. On design screen changing notifyicon1 property visible=false

    2. Insert the code below on main form "activated" event:

    NotifyIcon1.Visible = True
    
    1. Insert the code below on main form "closing" event:
    NotifyIcon1.Visible = false
    NotifyIcon1.Icon.Dispose()
    NotifyIcon1.Dispose()
    

提交回复
热议问题