Depends on what is on the form. You might compare the current state
with a snapshot of the last saved state. Or you might set an "IsDirty"
form member flag (or similarly named) to True every time anything is
modified on the form, then check this flag on exit.
The former approach will give you a more detailed view of what has
changed. The latter only an indication that something has changed.
One drawback of the latter approach is also that you cannot detect
if something was changed to something else, then back to the original
state, in which case you could have considered the form to be non-
changed.
I am sure there are plenty of patterns for dealing with this problem.
If you are working with bound controls, you might have to check
the documentation for the objects in use for information about what
I have described above.
Regards,
Joergen Bech
On Tue, 3 Jan 2006 13:39:09 -0500, "Bob" <bd*****@sgiims.com> wrote:
Using Vs 2005 and Vb.NET I want to give users a message asking if they're
sure they want to close the form if they had made changes to the underlying
data. How do I detect if changes had been made by user but not yet saved?
Thanks,
Bob