How to do dirty check on a win form?

  • Thread starter Thread starter Suba
  • Start date Start date
S

Suba

I am doing dirty check on my form. But when the user navigates away from the
form i need to prompt the user to save. I am showing a message box with
Yes/No/Cancel Buttons. Yes should save. No should ignore changes and on
cancel should stay in the same form.

I dont know on which event i should show the Message box prompting the user
to save. When i do it on leave its showing the form i need to show after
leaving. When i do it on validating event by setting e.cancel = true its
suppressing all the events after tat. Anyone has any idea how to do this
dirty check
 
I am doing dirty check on my form. But when the user navigates away from the
form i need to prompt the user to save. I am showing a message box with
Yes/No/Cancel Buttons. Yes should save. No should ignore changes and on
cancel should stay in the same form.

I dont know on which event i should show the Message box prompting the user
to save. When i do it on leave its showing the form i need to show after
leaving. When i do it on validating event by setting e.cancel = true its
suppressing all the events after tat. Anyone has any idea how to do this
dirty check

Maybe I'm completely off base here, but what about the Closing event?
 
Ah i couldnot use close event because my application has back button which
facilitates the user to view last 5 forms they viewed. So we are not actually
closing the form. We have all our forms in a mdi parent.

Is there any other way i can tackle dirty check?
 
Back
Top