Both logout and shutdown don't complete until I exit my app! All I'm doing
in my form's Closing event handler is setting the Cancel flag to True and
then calling the Hide() method. I would have thought that Windows closing
down or logging out would have automatically 'overruled' this....
> Odd!!!,
>
> Can I just check, are you saying that if you shutdown windows it works
> but not when you log off, or neither works.
>
> Simon
Diggers - 14 Apr 2005 18:39 GMT
Ah ok,
Setting the CancelEventArgs.Cancel to true will cancel closing the
form. Maybe its got to do with the fact that windows tries to close it,
you don't let Windows do that and then Hide the form (which of course
means its still running). Is there any reason to set the Cancel flag to
true and if so (for example you need to do some cleaning up first), do
your cleanup and then Close the form instead of hiding it.
Make sense?
Simon Rigby
Andy Pickering - 14 Apr 2005 18:56 GMT
Simon - thanks for the response.
The idea was that when the user clicks the form's close button, the app
minimises to the system tray - a bit like MSN Messenger. To implement this
I added the 'Closing' event handler (I was hoping this would work similar to
the old 'QueryUnload' event from my VB6 days....). In operation, it works
fine - it just has this unfortunate side effect!
> Ah ok,
>
[quoted text clipped - 8 lines]
>
> Simon Rigby
Diggers - 14 Apr 2005 19:00 GMT
ah of course, yes sorry you did mention that.
Hmm, I'll have a play and get back to you.
Simon