当应用程序关闭时,NotifyIcon会停留在任务栏上,然后当我将鼠标移到它上面时,它会消失。
我在关机时试过这个,
Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
Form2.NotifyIcon1.Visible = False
Form2.NotifyIcon1.Dispose()
End Sub
它仍然存在,对此有何建议?
感谢
答案 0 :(得分:0)
答案 1 :(得分:0)
对我来说,在设置Application.DoEvents()
到Icon
之后调用null
并处置NotifyIcon
时,它会有效。
Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
Form2.NotifyIcon1.Icon = Nothing;
Form2.NotifyIcon1.Dispose()
System.Windows.Forms.Application.DoEvents()
End Sub