WinForm closed during Windows restart

  • Thread starter Thread starter Looch
  • Start date Start date
L

Looch

All,

I have a form that has a text box and button - when the button is
pressed the form will close if the correct text is in the text box -
works fine.

However, if the text box is blank I can't reboot a Windows PC which I
want to allow (if I enter the correct text it will reboot). Is there
anything I can check in the form's OnClosing method to see if Windows
is trying to close the form as opposed to a user closing the form?

Thanks in advance
 
"However, if the text box is blank I can't reboot a Windows PC"
perhaps somehow during shutdown your form keeps waiting an answer,
but, as you dont say anything about your code, I assume that you re using
typical code, with no any reference to special codes that could interfere
with shutdown process, and this means you have something really wrong,
but as you say "if I enter the correct text it will reboot" I have no a clue
what to think about

hope this helps, Carlos.
 
Back
Top