This example uses the ImageModified property to see if changes were made to an existing image before permitting the user to open another. If the value of the ImageModified property is True, the code prompts the user to save the image before opening the next one.
Private Sub ImgEdit1_Close()
'This code could be used at the time a user attempts to open
'a new file or clear a previously displayed image in order
'to prompt for changes to be saved if the image has been modified.
Dim intSaveImg As Integer
If ImgEdit1.ImageModified = True Then
intSaveImg = MsgBox("Do you want to save changes?", vbYesNoCancel,
"Image has been modified")
Select Case intSaveImg
Case vbYes
'Save the changes
ImgEdit1.Save
'Drop down to the Open file code
Case vbNo
'Don't save file, just drop down to the Open
'file code
Case vbCancel
'User pressed cancel
'Don't open a file, don't save changes
Exit Sub
End Select
End If
'Open a new file at this point
End Sub