X Button

In visual cobol is there a way to trapped the X button on a winform being clicked.  I need to do some processing before closing the window. 

Thanks