You would have to handle the Closing or Closed events for the form, which is
not the same. However, there are other ways to close the form other then
clicking close. Like, clicking on the icon in the upper left hand corner and
selecting Close, or right clickign on the app in the taskbard, and clicking
close.
Make sure the handlers of these events know if the user chose Close off the
file menu, or not. If not, then presumably, you want this code to run. Just
wanted to point out it's not literally about clicking the X.
"Ronald S. Cook" <(E-Mail Removed)> wrote in message
news:OiZtF%(E-Mail Removed)...
> In my Windows app, users are clicking on the "X" in the top left corner
> instead of clicking File.. Exit. I have code that needs to run prior to
> the app shutting down. How can I capture the event when the user clicks
> the X?
>
> Thanks
> Ron
>
|