开发者

NotifyIcon stays on taskbar when app closes in visual basic 2010

开发者 https://www.devze.com 2022-12-13 13:48 出处:网络
NotifyIcon stays on 开发者_运维百科taskbar when application closed, then when I move mouseover it, it disappears.

NotifyIcon stays on 开发者_运维百科taskbar when application closed, then when I move mouseover it, it disappears.

I tried this on shutdown,

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

It still stays, any suggestion on this ?

thanks


Check Issue with NotifyIcon not dissappearing on Winforms App


For me, it works when calling Application.DoEvents() after settings Icon to null and disposing the 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
0

精彩评论

暂无评论...
验证码 换一张
取 消