I have this code :
private void Form1_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
Hide();
}
private void CloseApplication_Click(object sender, EventArgs e)
{
this.Close();
}
Then i resize hide the form or not resizing it i'm going with the mouse to the tray icon right click then select close application the Form is closed the application is closed.
But sometimes the icon of the application is stay in the tray icon and only if i move my mouse cursour over the icon he is gone . How can i make sure that when i close my application the icon in the tray icon will move/gone away ?