Gnana,
>I have a class (derived from form ) which is the base class for allmy dialogs. I set the Closable property to false so I have control over what goes on while closing the window.
The form QueryUnload() event will fire when the user clicks the X close button. You can call your control code from there.