Solved

Change tray icon or tray color WInForm

Posted on 2011-09-22
2
649 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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