Quote Originally Posted by MartinLiss
redshirtme, while it's OK to disable or bypass the X in control box, most users expect to find it there, so why not just call your close button code from the QueryUnload Event?
Martin makes an excellent point. I venture to say if you decide to go the disable the button route, you will get questions about why they can't do that. If you put whatever you need done in, as Martin suggests, the QueryUnload event, this code will execute regardless of how the user closes your application.

Although I keep the code I posted in my Code Library, I don't actually use it anymore. I did once, and got some 'unpleasant' feedback from my customers. From that point on, I started making use of QueryUnload.