Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 5.0 & SetFocus()
Message
De
17/12/1996 13:13:00
Paul Watson
Mcv Global Systems, Inc.
Pasadena, Californie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
VFP 5.0 & SetFocus()
Divers
Thread ID:
00015359
Message ID:
00015359
Vues:
116
In VFP 3.0 you could issue a SetFocus() to change the focus to a different prompt. In 5.0, a new error is genterated. Error 2212 - "Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event."

I have worked around this for the most part by moving my code from When & Valid events to GotFocus & LostFocus events. I have one problem left. My forms have the Save button on a toolbar. When the user clicks on Save, or on a navigation button, I need to check for changes and see if they want to save them. The problem is that the data entered in the currently active field is not recorded until the active control's Valid event fires. So, my RecordChanged method contains the following code:

* Force the Valid() event for the current prompt...
IF TYPE('ThisForm.ActiveControl') = 'O'
ThisForm.ActiveControl.SetFocus()
ENDIF
cResults = GETFLDSTATE(-1)

How can I force the Valid event for an active control to fire without issuing SetFocus?
Paul Watson
MCV Computer Consultants
MCV Global Systems, Inc.
pWatson@PrimeNet.Com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform