Henry Vuong

Henry Vuong

  • NA
  • 27
  • 0

How do I detect changes in a form and promt user to save before closing?

Sep 17 2008 9:59 PM
Let's say I have a form, on this form there's a datagridview and some text boxes, all databound. If a user opens the form and make some changes, when he closes the form without clicking the "Save" button, a message box should pop up and promt the user to save the data.

I know how to call the message box when user closes the form, but I only want this box pops up when there's some unsaved data on the form. How do I detect the changes from the last save?

Answers (2)