>in excel if the user changes any cell and then tries to quit the program warns the user that something has been changed.
>
>i need something similar, i have a form with about 15 text boxes and 3 inputable grids. can i flag if the user changes any text box or grid after they are first populated.
I've built this into my base classes. I've done this by adding property called lNoteChange to each of the input controls. Then in InteractiveChange and ProgrammaticChange, I raise a custom AnyChange method. My form class also has an AnyChange method.
Then, in the form Init, I call a method called BindControlEvents that binds the control's AnyChange to the form's:
LPARAMETERS toControl
LOCAL oControl
FOR EACH oControl IN toControl.Objects
IF PEMSTATUS(oControl, "lNoteChange", 5) AND oControl.lNoteChange
BINDEVENT(oControl, "AnyChange", This, "AnyChange")
ENDIF
IF PEMSTATUS(oControl, "Objects", 5)
This.BindControlEvents(oControl)
ENDIF
ENDFOR
Finally, in the form's AnyChange, I can react to user input:
This.lDataChanged = .T.
This.UpdateEnabled(.t.)
Tamar