PDA

Click to See Complete Forum and Search --> : Detect "X"


CyberCarsten
Jan 28th, 2000, 02:07 AM
How can i detect if the 'X' (Close button) in the right corner of the window have been clicked on??


------------------
Yours sincierly
CyberCarsten
http://home18.inet.tele.dk/cyber/
carsten.h.thomsen@mail.tele.dk

rino_2
Jan 28th, 2000, 02:27 AM
Use the unload event of the form. For example, if you didn't want the form to close when that X was pressed:

-----------
Private Sub Form_Unload(Cancel As Integer)
Cancel = True
End Sub
-----------

MartinLiss
Jan 28th, 2000, 04:30 AM
The check should be done in the QueryUnload event rather than the Unload event. See my answer (http://www.vb-world.net/ubb/Forum1/HTML/013185.html)to a previous question.

------------------
Marty
COGITO EGGO SUM
I think; therefore I am a waffle.