将事件处理的代码写入Form_QueryUnload中 Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) aa=msgbox ("asdasd",vbyesno,"aa111") if aa<>vbyes then cancel=true else unload me endif End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("确定要退出?", vbOKCancel, "系统提示") = vbCancel Then '选择了“取消按钮” Cancel = True End If End Sub
Private Sub Form_Unload(Cancel As Integer) aa=msgbox ("asdasd",vbyesno,"aa111") if aa<>vbyes then cancel=true else unload me endif End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("确定要退出?", vbOKCancel, "系统提示") = vbCancel Then '选择了“取消按钮” Cancel = True End If End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
End Sub
aa=msgbox ("asdasd",vbyesno,"aa111")
if aa<>vbyes then
cancel=true
else
unload me
endif
End Sub
If MsgBox("确定要退出?", vbOKCancel, "系统提示") = vbCancel Then
'选择了“取消按钮”
Cancel = True
End If
End Sub
aa=msgbox ("asdasd",vbyesno,"aa111")
if aa<>vbyes then
cancel=true
else
unload me
endif
End Sub
If MsgBox("确定要退出?", vbOKCancel, "系统提示") = vbCancel Then
'选择了“取消按钮”
Cancel = True
End If
End Sub