Solved

Checking for updates to any controls on Windows Forms?

Posted on 2014-10-08
2
103 Views
Last Modified: 2014-10-09
I have a routine in my Form_Closing() Event that checks each control on my form that could change in value. If the value changes then a boolean variable is set in the controls Leave() Event. This isn't working real. Is there a better way to check if any values were changed. For example, if I load some data into some TextBox controls and the user changes some of it, what is the best and easiest way to flag that?

Thanks!
0
Comment
Question by:BlakeMcKenna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40370126
In order for Leave to work, you need to have recorded the original value somewhere. TextChanged is better suited for your task, because it won't be called if the value does not change. Just do not forget to reset your boolean variables after you load data from the source.

An alternative would be to record the original data from the source into the Tag property. That property is free for you to use as you want. When you want to check if there has been a change, simply compare Tag to Text.
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 40370646
Ah...the tag property! I forgot about that one. Ironically, I have used that before and it does come in handy!

Thanks James!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MYSQL responding very slow 3 68
Run software updates from the website 6 51
EMAIL RANGES BASED ON CURRENT TIME 12 41
VB.net SQL Connection String Read Only 4 23
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question