我有一个带有NotifyIcon1
的winforms应用程序在后台运行,以显示以下代码的一些倒计时气球提示:
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
它在Windows 7
上运行良好,但在Windows 10
上运行,它导致气球多次出现,并且当倒计时结束时,它在Notification Area
中留下了一堆消息-我必须手动删除它们。
谁能给我一个建议:
Notification Area
中删除或隐藏这些消息(因为它已经完成了工作)。谢谢。