Difference between user vs window shutdown closing a form?

D

Du Dang

I tried to implement a feature like msn or yahoo messeger, where the user
click the "x" button, the form just hide itself to the tray icon.

I got it to work by added the following code to the closing event:

// Exit is a bool var false by default
// when i want close rather than hide i set Exit to true
if (!Exit){
e.Cancel = true;
}

that seem to work just fine, however when windows shutdown
since "Exit" still not true, the program remain open and windows refused to
shutdown

now to solve my dilema i need to know if the form called "Closing" event
because of a user or window shutdown function

any help would be appreciated!!!

Thanks,

Du
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top