Solved

Change tray icon or tray color WInForm

Posted on 2011-09-22
2
638 Views
Last Modified: 2013-11-27
I have my (first) WinForm that loads in the tray and shows an icon

How can I make it swap out the icon (or just change color) based on an event?
For development purposes, maybe just have it cycle colors every 20 seconds?
0
Comment
Question by:lrbrister
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36582364
Add a Timer to your Form and set its Interval property to the time you want (in milliseconds, so 20000 for 20 seconds).

Supporsing that your icons are in the application resources, program the Tick event of the timer this way:
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick

   Static flag As Boolean

   If flag Then
      flag = False
      NotifyIcon1.Icon = My.Resources.Icon1
   Else
      flag = True
      NotifyIcon1.Icon = My.Resources.Icon2
   End If

End Sub

Open in new window

0
 

Author Closing Comment

by:lrbrister
ID: 36600636
Thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now