Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enter in a text box
Message
 
À
17/07/2000 14:04:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00393414
Message ID:
00393430
Vues:
16
>I want to be able to hit enter in a textbox and the code to execute for that textbox and then return focus to that textbox. I have two lines of code in the valid event but when I press enter I go to the next control on the form, I can't set focus to the textbox in the valid event. How would I do this?
>
>Thanks,
Tyler,

While both Tom and Nadya are correct, you can also return a logical value from the valid event to prevent the cursor from leaving a control. I prefer using this technique over using a numeric for a couple of reasons. Chiefly because I can simply assign the return value in the function based on a logical expression. For example, if the control needs to accept a date field and the date field needs to be a date in the future: llresult = (This.Value > DATE()) acheives the desire effect.

You should also know that return a numeric value from the Valid event can control where the cursor goes next.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform