I'm currently trying to get my program to minimize to the system tray, because the software need to be able to perform a task in the background. Currently, the program does create the icon in the system tray. The only problem I'm having right now is the program wants to stay in both the taskbar and the system tray when minimized. I'm not sure what else to do. Can someone please look it over and tell me if I'm missing something?
#region Minimize to System Tray
public void Form1_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon1.Visible = true;
ShowInTaskbar = false;
}
else if (FormWindowState.Normal == this.WindowState)
{
notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
}
}
#endregion
I'm not quite sure how it's even creating the icon in the system tray, because I can't seem to figure out how to tell the program to use this function when I press the minimize button. Am I misunderstanding something? Any help will be greatly appreciated.

New Topic/Question
Reply




MultiQuote







|