Hello again guys, this time I need help with the FormClosing() Event in the Picture Viewing application I made. I wanted it to prompt the user before closing the form (if he had any unsaved changes) and I did it without help. But, the bad thing is, when someone saves a picture, the prompt will appear again! The code that I used in order to get this half-working is below. BTW, thanks in advance.
Private Sub ChildForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If picShowPicture.Image IsNot Nothing Then If MessageBox.Show("You've got unsaved changes. Are you sure you wish to proceed in closing this file without saving?", "Gavo® Ultimate Suite 2010", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.No Then e.Cancel = True End If End If End Sub
Edited by TechSupportGeek: n/a