473,670 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Identifying if values on a form change

I have a windows form which contains various controls like textboxes,
comboboxes, checkboxes etc.

When the user clicks the ok button I would like to determine if the data
has changed in one or more of this controls.

What is the easiest way to find this information out.

If data is changed I will update the record. If no I will just ignore
the update.

Regards
Jeff
Jul 7 '07 #1
2 1300
"Jeff Williams" <je************ *******@hardsof t.com.auwrote in message
news:13******** *****@corp.supe rnews.com...
>I have a windows form which contains various controls like textboxes,
comboboxes, checkboxes etc.

When the user clicks the ok button I would like to determine if the data
has changed in one or more of this controls.

What is the easiest way to find this information out.

If data is changed I will update the record. If no I will just ignore the
update.
I've done this in the past as follows:
When loading the form, I loop recursively through the Controls collection
finding all the controls that are of one of the types whose changes I want
to monitor. For each of these controls, I connect its Change event to a
common method in the form (one for each kind of change event, since the
EventArgs is not the same for all the kinds of control). This method sets a
flag when it detects a chage, and this flag is what I monitor for changes
when closing the form.
Jul 7 '07 #2
PS

"Alberto Poblacion" <ea************ *************** ***@poblacion.o rgwrote
in message news:uI******** *****@TK2MSFTNG P04.phx.gbl...
"Jeff Williams" <je************ *******@hardsof t.com.auwrote in message
news:13******** *****@corp.supe rnews.com...
>>I have a windows form which contains various controls like textboxes,
comboboxes, checkboxes etc.

When the user clicks the ok button I would like to determine if the data
has changed in one or more of this controls.

What is the easiest way to find this information out.

If data is changed I will update the record. If no I will just ignore
the update.

I've done this in the past as follows:
When loading the form, I loop recursively through the Controls
collection finding all the controls that are of one of the types whose
changes I want to monitor. For each of these controls, I connect its
Change event to a common method in the form (one for each kind of change
event, since the EventArgs is not the same for all the kinds of control).
This method sets a flag when it detects a chage, and this flag is what I
monitor for changes when closing the form.
And in addition to this you can disable your OK button until a change has
been made. This will provide the user with an indicator that they have made
a change.

PS
Jul 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2756
by: monika | last post by:
I move from one form to another when I click to a radio button. I can identify which radio button I clicked by trapping its value. but my problem is that there are a set of radio buttons followed by values being displayed from a join table. I want to know the values displayed from the table. so that based on which I can do my further processing. Like the radio button is showing the name of student, his id, story id...and 2-3 more things....
1
1342
by: A P | last post by:
Hi! Is there a way where I can identify if the field sent was modified? Me
7
2435
by: hungrymind | last post by:
Hi all, I am developing some control (textbox based), to validate inputs to that control I am using regular expression, where pattern is generated dynamically. I need to identify what all charcters are allowed with that particular pattern. Is this possible or any way to solve this. Or else, i want to identify if only one character is allowed then that character will apear & user need not to enter any value for that. Please suggest if...
3
2126
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do this: SomeRow = 'value'; But how do I set SomeRow to the row that the user is currently viewing?
3
2832
by: Douglas Douglas | last post by:
Hi everybody. I have a paper form that I scan into an image. My user fills some circles in this paper form using black ink. Every form has ten rows with five circles each and the user fills only one circle for each row. I was wondering if I could use the Python Imaging Library to process these forms. I know the Image class is really powerful, but I can't think of a way of how to locate wich circle was filled.
3
1153
by: NithyaChandrasekar | last post by:
Hi, When the form(including the controls) is inactive for more than 2 min, the form should be automatically closed. I would like to know the way the code has to be for identifying that no controls in the form has been fired or no action is performed in the screen. In other words, the code we can use to identify the firing of an event in the form. How should the coding be done for this case? Your ideas would be highly appreciated. Thanks...
0
4092
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me with my problems. Now for my new little problem,I had a problem posting the values from checkbox fields to a database and thats the obstacle I overcame. Now the second part is my new problem is that I want that the next time that page loads for...
1
1903
by: RP | last post by:
On my Windows Form, I have ten text boxes. I also have a DataGridView. When a user clicks a row on the DataGridView, the column values get displayed on their respective text boxes and are available for user to edit or delete that record. At present, I am using a boolean variable and it's value becomes true whenever a user replaces old text in the Text Box with a new text. When the user clicks a button, it checks whether the value of this...
5
10309
by: Rider | last post by:
Hi All, Here is the reason why i ak asking for ur help. I have a edit form in which the values already stored in DB are populated. User can edit some or all the values in the form. then he submit the form. NOW I WANT SOME JAVASCRIPT / PHP FUNCTIONALITY WHICH WILL GIVE ME THE types & values OF ALL ELEMENTS ON FORM WHICH SHOULD BE before
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8813
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.