It is my understanding that in order to get an Icon to display in the system tray, I need to use the NotifyIcon.
Using the code below, I can get my application to work similar to other tray apps. I say similar in that when I click the "Close" button, the app will minimize, but instead of minimizing to the tray (like MSN messenger with the animation), my app minimizes just above the "Start" button. Is there a way to get the animation to go to the system tray? To get around this, I hide the app first, then minimize so you don't even see the minimize animation.
Using the code below, I can get my application to work similar to other tray apps. I say similar in that when I click the "Close" button, the app will minimize, but instead of minimizing to the tray (like MSN messenger with the animation), my app minimizes just above the "Start" button. Is there a way to get the animation to go to the system tray? To get around this, I hide the app first, then minimize so you don't even see the minimize animation.
Code:
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
this.Hide();
}