找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 4580|回复: 0

vb.net中如何实现:在运行时关闭窗体,弹出对话框提示是否要关闭

[复制链接]

482

主题

48

回帖

7298

积分

管理员

积分
7298
发表于 2020-1-15 18:18:36 | 显示全部楼层 |阅读模式
    Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        Dim myti As Integer
        myti = MsgBox("确定退出此界面?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "提示")
        Select Case myti
            Case MsgBoxResult.Yes
                e.Cancel = False
            Case Else
                e.Cancel = True
        End Select
    End Sub

QQ|手机版|小黑屋|爱淘机 ( 鲁ICP备2022040313号-4 )

GMT+8, 2025-5-9 22:53 , Processed in 0.144222 second(s), 24 queries .

Powered by 爱淘机

© 2001-2025

快速回复 返回顶部 返回列表