Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.setfocus method
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00122406
Message ID:
00122448
Vues:
22
Sorry about that, but the solution will still work.

>>The enter keystroke is being sent to your second textbox. Add a nodefault inside your condition to prevent this from happening.
>>
>>ie:
>>

>>IF MCard_Nbr <> Card_Nbr .OR. DELETE()
>> nodefault
>> do quickmsg with "CUSTOMER'S CARD NO. NOT ON FILE"
>> thisform.mytextbox1.setfocus()
>> thisform.refresh
>>ENDIF
>
>I have one textbox and a quit(cmdbutton). The user enters his data and if it's not on file, I want the setfocus to go back to the textbox. Pure & simple. I think
>
>
>>
>>>>>>>For some reason the focus does not get set in the following:
>>>>>>>store allt(thisform.mytextbox1.value) to mcard_nbr
>>>>>>> SEEK MCARD_NBR
>>>>>>> IF MCard_Nbr <> Card_Nbr .OR. DELETE()
>>>>>>> do quickmsg with "CUSTOMER'S CARD NO. NOT ON FILE"
>>>>>>> thisform.mytextbox1.setfocus()
>>>>>>> thisform.refresh
>>>>>>>
>>>>>>>Is there a fault here?
>>>>>>>thanks
>>>>>>
>>>>>>If this code is being executed in a Valid event, Setfocus() can not be executed in the Valid in VFP5.
>>>>>>
>>>>>>Bill
>>>>>It's evaluated in the keypress event, forgot to mention that.
>>>>
>>>>KeyPress does not seem like the place to execute this code or it will be executed on every key stroke and the record could not be found until the whole card number was entered.
>>>
>>>Actually, I left out one last thing, the only keypress it checks is if the user hit enter thus: if nkeycode=13
>>>otherwise it works correctly ,cept for the setfocus part.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform