Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
THISFORM.Object.SetFocus() problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00212351
Message ID:
00212352
Vues:
20
>I have a form with two Text Boxes and two Command Buttons. One command button is an Ok button. I want to set the focus to the first Text Box if the validation routine on the Ok button fails. When I issue THISFORM.cTxtLoginName.SetFocus() in the Keypress() event of the Ok command button the focus goes to the first text box and then jumps to the next text box. If I change the set focus to the second text box the focus changes to the second text box then to the ok button. If I set the focus to the Cancel button the focus changes to the cancel button and then presses the cancel button. It is if an [enter] key is hanging around. I tried =INKEY(.005) prior to the SetFocus() command. but this did not change anything. Any ideas wou;d be appreciated. I am tired of being stuck...

Why not just put the setfocus() call from the CLICK() event of the Ok Button instead of the KeyPress(). But if it has to be in KeyPress(), you might try issuing a NODEFAULT after the setfocus() command.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform