vb保存对话框的退出调用问题
在选择“是”之后如果再在“保存”对话框中选择了“取消”就无法保存当前的操作了。请那位高手指点一下!!!!!
代码如下:
Private Sub Form_Unload(Cancel As Integer)
a = MsgBox("文件已改变,您真的要保存吗?", vbExclamation + vbYesNoCancel, App.Title)
If a = vbYes Then
CommonDialog1.DialogTitle = "保存"
CommonDialog1.Filter = "*.*"
CommonDialog1.ShowSave
ElseIf a = vbNo Then
End
Else
Cancel = True
Exit Sub
End If
End Sub