Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

How would I tell when a winform is "dirty"?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C - 28 Feb 2007 10:24 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.