I try to Minimize my winform application into system tray and when minimize my application it still open in task bar and not in system tray and close automatic after few seconds
i have added NotifyIcon
control and register to Resize
event:
private void MainWin_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(500);
this.Hide();
}
else if (FormWindowState.Normal == this.WindowState)
{
notifyIcon1.Visible = false;
}
}