0

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

MPelletier
  • 16,256
  • 15
  • 86
  • 137
Utku Dalmaz
  • 9,780
  • 28
  • 90
  • 130

2 Answers2

0

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
Cubi73
  • 1,891
  • 3
  • 31
  • 52
0

Check Issue with NotifyIcon not dissappearing on Winforms App

Community
  • 1
  • 1
HuseyinUslu
  • 4,094
  • 5
  • 33
  • 50