Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indication if the user types anything
Message
De
28/05/2009 13:55:22
 
 
À
28/05/2009 09:47:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01402454
Message ID:
01402512
Vues:
57
>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:
* Bind events of controls to events of the form as appropriate
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform