Capture Xing out of program and run File/Exit

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

I want when someone clicks the X in the upper right corner of my program
for it to run the sub I've put in for the exit item on the main menu
(exitMenuItem_click)
 
cj said:
I want when someone clicks the X in the upper right corner of my program
for it to run the sub I've put in for the exit item on the main menu
(exitMenuItem_click)

Add a handler to the form's 'Closing' or 'FormClosing' (.NET 2.0) event. In
..NET 2.0 you can determine the reason for closing the form inside the event
(check out the handler's 'e' parameter!).
 
Hi ,
Thanks for Herfried's reply!

I just wanted to check how things are going and whether Herfried's
suggestion is useful for you. If there is any question, please feel free to
join the community and we are here to support you at your convenience.
Thanks for your understanding!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
 
Back
Top