|
I have a class called CTask, used to implement in memory a TASK table in a database. Class properties are something like ID (read only), Startdate (read & write), Comments (read & write), etc; there are also several methods, but they are not importatnt for my question.
I have a form which is displayng information about the task from the CTasK class and of course it is also possible to update these information.
so for example on the form there is a DatePicker control to display & change the Startdate, and there is a texbox for Comments.
I need a way to mark the cCtask as updated when any of the above information has changed. of course I added a private variable called mUpdated (boolean) which is originally set to FALSE when the class is loaded; it is set to TRUE by every LEt method for each property.
Up to now no problem for me (and i hope I've been clear enough).
Now, what i want to do is to update a CTask property each time the corresponding control on the form is changed.
For the Startdate this is simple: in the OnChange event of the Datepicker control I update the Startdate property of my class (so the LET method will set the class status to TRUE).
But how can i do the same for the Comments textbox? If I use the same Onchange event, every time I add a letter, the class property will be updated and the class status updated, even if not necessary. is tehre a way to avoid this?
thanks a lot for any suggestion
|
|
|
|
|
|
|
|