Prevent form closing

How can I avoid closing the form if the click is crossed by mistake

+2


source to share


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







All Articles