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.

Re: How would I tell when a winform is "dirty"? by Kevin

Kevin
Wed Feb 28 07:10:00 CST 2007

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.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

I had the same problem once. Fixed it using the same solution.

"David C" <profnachos@gmail.com> wrote in message
news:1172658268.177421.203220@v33g2000cwv.googlegroups.com...
>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.
>