Hi, I have a vewwy simple app which just sits in the system tray while doing its work. When a user double clicks the notification icon, a config window opens and you can edit some settings there. Right now, I have a simple form which will be hidden from the user and show a notification icon when formstate is set to minimized.
private void TrayForm\_Resize(object sender, EventArgs e)
{
if (FormWindowState.Minimized == this.WindowState)
{
notifyIcon1.Visible = true;
this.Hide();
//this.ShowInTaskbar = false;
}
else if (FormWindowState.Normal == this.WindowState)
{
notifyIcon1.Visible = false;
}
}
For some reason, this works under windows xp, in windows7 I have to disable the ShowInTaskbar call, as that causes a stack overflow in the current thread. If I don't use the call, the form is minimized and remains visible on the taskbar, annoying at best. Any workarounds? (or am I doing something stupid here...?)
A good programmer is someone who always looks both ways before crossing a one-way street. (Doug Linder)