locked
Flashing System Tray Icon RRS feed

  • Question

  • Can anyone advise me on how to go about making a system tray icon that flashes? I've created a network monitoring app that sits in the background and when the network goes down I want the icon in the system tray to flash. Not sure how to do this.

    Thanks.
    Thursday, March 29, 2007 5:12 PM

Answers

  • Set the Icon Property of the NotifyIcon object. Use a timer to toggle it, for example:

     

    Code Snippet

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    Static Toggle As Boolean

    Toggle = Not Toggle

    If Toggle Then

    NotifyIcon1.Icon = My.Resources.Normal

    Else

    NotifyIcon1.Icon = My.Resources.IconRed

    End If

    End Sub

     

     

    Thursday, March 29, 2007 6:54 PM

All replies

  • Set the Icon Property of the NotifyIcon object. Use a timer to toggle it, for example:

     

    Code Snippet

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    Static Toggle As Boolean

    Toggle = Not Toggle

    If Toggle Then

    NotifyIcon1.Icon = My.Resources.Normal

    Else

    NotifyIcon1.Icon = My.Resources.IconRed

    End If

    End Sub

     

     

    Thursday, March 29, 2007 6:54 PM
  • Thanks! Works like a charm.
    Thursday, March 29, 2007 8:23 PM