Prevent form closing
1 answer
Handle this in the Form QueryUnload event. There's an UnloadMode parameter and a cancellation parameter:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then Cancel = True
End Sub
For more information on the QueryUnload event, see the MSDN VB6 Language Reference or check out this article .
+10
source to share