Torna al Thread
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If BoolModified=True Then
Dim answer As Integer
answer= MessageBox.Show("The current document has not been saved, would you like to continue without saving?", "Unsaved Document",MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If answer = Windows.Forms.DialogResult.No Then
Cancel=True ' Annulla la chiusura del Form
Exit Sub
Else
Application.Exit()
End If
Else
Application.Exit()
End If
End Sub