Auto remove or hide app's notification from Notification Area in Win10

234 Views Asked by At

I have a winforms app works in the background with a NotifyIcon1 to show some countdown balloon tips with the code below:

Private Sub tmrCountdown_Tick(sender As System.Object, e As System.EventArgs) Handles tmrCountdown.Tick
    If countdown > 60 Then
        countdown -= 1
    Else
        If countdown > 0 Then
            countdown -= 1
            ShowTrayNotification()
        Else
            NotificationForm.Show()
        End If
    End If
End Sub

Private Sub ShowTrayNotification()
    NotifyIcon1.BalloonTipIcon = ToolTipIcon.Info
    NotifyIcon1.BalloonTipTitle = "You have an appointment in "
    NotifyIcon1.BalloonTipText = countdown & " seconds ... "
End Sub

It runs well on Windows 7 but on Windows 10, it causes the balloon to appear multiple times, and when the countdown is up, it leaves a bunch of messages in the Notification Area - which I have to remove them manually.

Could anyone give me a suggestion to:

  • Remove or hide these messages from the Notification Area (because it has done its job).
  • Let the balloon tips appear once when counting-down, not each time the timer ticks.

Thank you.

0

There are 0 best solutions below