Form Exit

quddusaliquddus

Active member
Joined
Nov 20, 2007
Messages
25
Programming Experience
Beginner
Hi all :),
I was wondering whether anyone knew where to place code to make it run just before a form exits.

Is it possoble to do this?

Many thanks :D

Q
 
There is an event on the form called "Closing" and "Closed"

From MSDN Help:
The FormClosing event occurs as the form is being closed. When a form is closed, it is disposed, releasing all resources associated with the form. If you cancel this event, the form remains opened. To cancel the closure of a form, set the Cancel property of the FormClosingEventArgs passed to your event handler to true.
 
note the tense of the naming there

xxxING = event happening before the action completes
xxxED = event firing after.

Closing -> before close
Closed -> after close

Focusing -> before focus
Focused -> after focus
 
Back
Top