K
kurotsuke
How can I hide a Form (instead of having it reduced to the taskbar)
when the minimize button is pressed in C# (there's an icon in the tray
bar)?
I added the code
protected override void OnResize(EventArgs e)
{
//hide the form
if
(this.WindowState==FormWindowState.Minimized)
{
this.Hide();
this.WindowState=FormWindowState.Normal;
}
else
{
base.OnResize (e);
}
}
The problem is that when I clic on the tray icon the form unhides and
appears minimized (I would like it to be just restored).
Thanks a lot.
Andy
when the minimize button is pressed in C# (there's an icon in the tray
bar)?
I added the code
protected override void OnResize(EventArgs e)
{
//hide the form
if
(this.WindowState==FormWindowState.Minimized)
{
this.Hide();
this.WindowState=FormWindowState.Normal;
}
else
{
base.OnResize (e);
}
}
The problem is that when I clic on the tray icon the form unhides and
appears minimized (I would like it to be just restored).
Thanks a lot.
Andy