Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This.setfocus not setting focus
Message
De
19/01/2000 08:49:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
This.setfocus not setting focus
Divers
Thread ID:
00319809
Message ID:
00319809
Vues:
50
Hello there,
I have a listbox on my form, and when the user types something, and presses return, I want that value to be entered into a listbox, and then keep the focus on the textbox to potentially enter more data. Here is my code from the textbox's keypress event.

LPARAMETERS nKeyCode, nShiftAltCtrl
if nKeyCode = 13
this.parent.command1.click()
this.setfocus
endif

The line this.parent.command1.click() properly fires that buttons click event which is what enters the textbox's value into the listbox. However, this.setfocus doesn't return the focus back to the textbox (remember, this code is from my textbox.keypress event). The focus, instead, remains on the command1, whose click event is fired by this code. Any idea of why it performs this way, and how I can get the focus where I want it?
Paul A. Busbey
Victoria Insurance
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform