Notes:
-
You must add the NotifyIcon,a Timer and icons to your project.
-
This code uses 4 ico files which cycle through.
-
The timer increments currentIcon from 0 to 4 and then resets when 4 is reached.
The number of the variable relates to the icon at that index.
public Form1()
{
InitializeComponent();
timer1.Start();
}
private Icon[] icons = new Icon[5];
private int currentIcon = 0;
private void Form1_Load(object sender, EventArgs e)
{
icons[0] = new Icon("1.ico");
icons[1] = new Icon("2.ico");
icons[2] = new Icon("3.ico");
icons[3] = new Icon("4.ico");
}
private void timerIcon_Tick(object sender, EventArgs e)
{
notifyIcon1.Icon = icons[currentIcon];
currentIcon++;
if (currentIcon == 4)
currentIcon = 0;
}