关于MDI窗口的问题!?

sunrain_leo 2003-09-18 12:29:32
当关闭MDI窗口时(即点击窗口右上角的关闭按钮时),弹出对话框:
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
End
End If

点击OK退出,点击CANCEL取消操作,窗口不退出!
...全文
49 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
道素 2003-09-18
  • 打赏
  • 举报
回复
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
End
Else
Cancel = 1
End If
End Sub
vv1vv 2003-09-18
  • 打赏
  • 举报
回复
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
End
Else
Cancel = 1
End If
End Sub
didishu0807 2003-09-18
  • 打赏
  • 举报
回复
cancel=true
strongfisher 2003-09-18
  • 打赏
  • 举报
回复
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
End
Else
Cancel = true
End If
End Sub
zwbhyy 2003-09-18
  • 打赏
  • 举报
回复
我用这个

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
End
Else
Cancel = 1
End If
End Sub
dreamreality 2003-09-18
  • 打赏
  • 举报
回复
cancel 只在真假之别,不为0都是真,为0则为假
zxwitsme 2003-09-18
  • 打赏
  • 举报
回复
up
如果cancel=-1会怎么样,窗口也不会关闭吧
accp258 2003-09-18
  • 打赏
  • 举报
回复
private sub form_queryunload(cancel as integer,unloadform as integer)
If MsgBox("警告:系统退出后接收仪将停止运行!" + vbCrLf + "是否确定退出系统?", vbOKCancel + vbInformation, "系统提示") = vbOK Then
end
else

cancel=true
end if

end sub


7,789

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧