I have this code and when i minimise the application should disappear from the taskbar and only be visible in the tray and when i double click on the tray icon it show maximise the app. but neither functions are working, i can display the notifyicon in the tray fine, thats it!??
Also can anyone tell me how to override the 'X' to minimise the app. and not exit it?
Code:
private void Form_Resize(object sender, System.EventArgs e)
{
if (FormWindowState.Minimized == WindowState)
this.ShowInTaskbar = false;
if (FormWindowState.Maximized == WindowState)
this.ShowInTaskbar = true;
}
private void notifyIconMain_DoubleClick(object sender, System.EventArgs e)
{
Show();
WindowState = FormWindowState.Normal;
}


Comment