в визуал бейсике есть такая вещь, вставляется в Form_Unload
что-то типа
if ExitMode = vbCode Then Cancel = 1
как точно это выгладит? и какие константы?
Option Explicit
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim Result As VbMsgBoxResult
Select Case UnloadMode
Case vbFormControlMenu '0 - User has chosen Close command from Control menu box on form.
If (Not DocSaved) Then
Result = MsgBox("Save this document?", vbQuestion + vbYesNoCancel)
If (Result = vbYes) Then
Call SaveDoc
ElseIf (Result = vbCancel) Then
Cancel = True
End If
End If
Case vbFormCode '1 - Unload method invoked from code.
Case vbAppWindows '2 - Current Windows session ending.
Case vbAppTaskManager '3 - Windows Task Manager is closing the application.
Case vbFormMDIForm '4 - MDI child form is closing because the MDI form is closing.
Case vbFormOwner '5 - The owner of the form is closing.
End Select
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 9