If I remember correctly you have to override the mouse click event for
the form and the calculate if it is in that section. I could be wrong,
and I'm sure someone will correct me if I am.
This means if the user clicks the ControlBox the application isn't closed,
but is handled how you need it. So this in conjunction of the Form_Closing
event is what you need
If I have a button, "Apply" on the form and the user clicks it and I close
the form in this button click event, then the form closing event fires also
so I don't know which action the user took in the Form Closing event, i.e.,
clicked the button or the control box close. I know I could set a form
scoped variable boolean and set it to true in the button click event then
check it in the control box close event but I was hoping for something a bit
more elegant!
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.