You Can Find it for VB.Net:cool:
This Is the Form Closing event automatically raised when form closes
Private Sub Form1_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If textBox1.Text <> strMyOriginalText Then
If MessageBox.Show("Do you want to save changes to your text?", "My Application", MessageBoxButtons.YesNo) = DialogResult.Yes Then
e.Cancel = True
End If
End If
End Sub
End Class