Yes.You use the Before close event to trap the attempt to close and setcancel=true unless the close is from your own close function.You have to have a flag which is set by your own close function so that thecancel=true is bypassed..