Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program Error - Cannot call SetFocus from within ...
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Program Error - Cannot call SetFocus from within ...
Divers
Thread ID:
00120667
Message ID:
00120667
Vues:
95
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.
Chuck Henry
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform