Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lostfocus problem
Message
 
 
À
14/03/2010 17:17:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01454443
Message ID:
01454451
Vues:
74
This message has been marked as the solution to the initial question of the thread.
>Hi All:
>
>This doesn't work:
>
>On a textbox named txtCardNumber I have the following in the lostfocus():
>
>
>thisform.ValidateLocal()
>
>
>In ValidateLocal, the following code:
>
>
>IF CardType(thisform.txtCardNumber.value) = thisform.cboCardType.Value
>ELSE
>	MESSAGEBOX('This is not a valid number for ' + thisform.cboCardType.Value + '; Please ReEnter',48)
>	thisform.txtCardNumber.SetFocus()
>ENDIF
>
>
>The messagebox executes, but focus does not go to the txtCardNumber, but rather to the next textbox in the form!
>
>??
>
>Yossi

Try instead
if not thisform.ValidateLocal()
   nodefault && focus remains in the txt
endif
Remove SetFocus line from ValidateControl method and change it to:
IF CardType(thisform.txtCardNumber.value) = thisform.cboCardType.Value
ELSE
	MESSAGEBOX('This is not a valid number for ' + thisform.cboCardType.Value + '; Please ReEnter',48)
	return .F.
ENDIF
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform