zoukankan      html  css  js  c++  java
  • 关闭form前提示是否保存

    在form的formclosing事件中加上判断:

    Private Sub frmSequenceEditor_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            If MessageBox.Show("The file has changed!would you like to save?", "Save file", MessageBoxButtons.YesNoCancel) = Windows.Forms.DialogResult.Yes Then '提示是否保存
                dlgSaveFile.InitialDirectory = Application.StartupPath
                dlgSaveFile.OverwritePrompt = True
                dlgSaveFile.Filter = "BurnIN Files(*.DUT)|*.DUT|All Files(*.*)|*.*"
             
                If (dlgSaveFile.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
                    Dim FileName As String = dlgSaveFile.FileName
                    ' TODO: Add code here to save the current contents of the form to a file.
                    Dim str As String = ConfigDataXml(dgvSequence)
                    DutData.SaveDutFile(FileName, str)
                    MessageBox.Show("Save To Dut success! The file path is " + FileName)
                    'end
                End If
            Else

            End If
        End Sub

  • 相关阅读:
    Bugku web web基础$_GET
    Bugku web 计算器
    Bugku web web2
    Bugku 杂项 宽带信息泄露
    Bugku 杂项 猜
    Bugku 杂项 又一张图片,还单纯吗
    Bugku 杂项 啊哒
    Bugku 杂项 眼见非实(ISCCCTF)
    Bugku 杂项 telnet
    Bugku 杂项 隐写
  • 原文地址:https://www.cnblogs.com/huige1004/p/1339697.html
Copyright © 2011-2022 走看看