Capture Form Close Click Event (Red X)

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hi Everyone,

Could you please help with a little problem. I have code a very simple Windows Form that closes the form. I want to capture an event where the user has instigated the close by clicking the Close Button (red x), rather than a close instigated by code.

The Closing event fires when both ways of closing the form is used, but I want to differentiate between the two ways and capture the click event of the Close Button.

Any ideas where I could find information on this?

Thanks,
Shai

View the full article
 
Back
Top