Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program Error - Cannot call SetFocus from within ...
Message
De
23/07/1998 15:01:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00120667
Message ID:
00120676
Vues:
33
Hi Chuck ---

What is the realworld of what you are trying to do? Also, have you considered using the InterActiveChange method instead of Valid for this situation?



>ERROR CONDITION:
>'Program Error - Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event.'
>
>CAUSED BY:
>ThisForm.Grid1.Column1.SetFocus() in ThisForm.Combo1.Valid
>
>THE VFP5 HELP STATES:
>Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event (Error 2012)
>
>The SetFocus method conflicts with these events, which are testing to see if the object can get or lose focus.
>
>· You are calling SetFocus from a When event.
>
>Call SetFocus from the GotFocus event instead.
>
>· You are calling SetFocus from a Valid, RangeHigh, or RangeLow event.
>
>Call SetFocus from the LostFocus event instead.
>
>WHAT I DID:
>I moved ThisForm.Grid1.Column1.SetFocus() to the Lost Focus event, per the VFP5 Help as noted above.
>
>PROBLEM REMAINING:
>When you click on a selection from the dropdown list of Combo1, the Valid Event fires but the focus doesn't change. However, the focus will change if you hit the tab key while in Combo1 (causing the LostFocus Event to fire).
>
>SOLUTION: ???
>Is there a way to call LostFocus from Valid anytime Valid fires? Thanks in advance, CH.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform