Thanks for your suggestion François, but thats not quite what I was hoping
for. When my application is running and I choose to shut-down my computer,
my application just gets minimised and stays running and my computer does
not shutdown (because the Closing event is cancelled). What I think I need
to know is how can I tell if the user has clicked on the [X] button so I can
handle that instead of hooking in to the Closing event?
Thanks again
John
François J. Miton said:
Hi John,
You can hook the "closing" event of the form and minimaze it (and
cancel
the
event)
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
this.WindowState = FormWindowState.Minimized;
e.Cancel=true;
}
HTH
François J Miton
Hi
Instead of closing the form when the close button [X] is clicked, I want
the
form to minimise. Does anyone know how to do this (using C#)?
Thanks for any help
John