I need to know if at least one of the winform's controls have been
edited by the user. Controls can have textboxes, combo boxes,
datagrid, etc.
If any one of the forms have been touched and the user hits the exit
button, I want the form to ask if the changes should be saved to the
database.
So what I am looking for is really simple. Thanks.
Kevin Spencer - 28 Feb 2007 13:10 GMT
You create a boolean property of the Form called "Dirty." Each form element
must have the handlers to indicate whether a change has occurred which would
cause the Form to become "Dirty" according to your definition. The handlers
will set the property to true. You also have to decide the business rules
for setting the property to false, such as creating a new document or file
of whatever type you're creating.

Signature
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
I had the same problem once. Fixed it using the same solution.
>I need to know if at least one of the winform's controls have been
> edited by the user. Controls can have textboxes, combo boxes,
[quoted text clipped - 5 lines]
>
> So what I am looking for is really simple. Thanks.