in vb/vb.net u have a method wich is called when the form is closed, what is the c# equivelent??

or is there a better way, i have a thread which i want to end with the form, but if the user clicks the window close button the thread keeps right on going