How to do dirty check on a win form?

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
 
B

Brian Gideon

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?
 
S

Suba

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top