I have the following code to disable Alt-F4...
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
Cancel = 1
End If
End Sub
This works fine on a freshly made app, but when I use this code on an existing application with 100's of lines of code, I can close it by pressing Alt-F4 a bunch of times. I really can't have this. Is there another way to ensure the user can't close it by pressing Alt-F4?? or anyone else have this issue?
(I have 2 forms, both have this code place within it, and both are open at the time I hit Alt-F4.)
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then
Cancel = 1
End If
End Sub
This works fine on a freshly made app, but when I use this code on an existing application with 100's of lines of code, I can close it by pressing Alt-F4 a bunch of times. I really can't have this. Is there another way to ensure the user can't close it by pressing Alt-F4?? or anyone else have this issue?
(I have 2 forms, both have this code place within it, and both are open at the time I hit Alt-F4.)