dominicwong
asked on
How to detect if user has made changes to a windows application in C#
Hi experts
I am developing a C# .NET 3.5 applications using Winform.
I wonder how to detect user has made any changes so that it will prompt the user to save settings before exiting from the application.
Thanks in advance.
I am developing a C# .NET 3.5 applications using Winform.
I wonder how to detect user has made any changes so that it will prompt the user to save settings before exiting from the application.
Thanks in advance.
ASKER
Thanks EaswaranP.
But what if my application has hundreds of Controls such as Textbox, Combobox, checkbox, dgv, etc, it would be tedious to add a flag to every event handler.
But what if my application has hundreds of Controls such as Textbox, Combobox, checkbox, dgv, etc, it would be tedious to add a flag to every event handler.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks julianH and EaswaranP.
These links are excellent references!!
These links are excellent references!!
Once user Save/Cancel then the flag should be reset IsModified = false.
If IsModified = true and user tries to close the application, then the user could be prompted.