Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keeping focus in a field
Message
 
 
À
31/10/2008 15:48:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01358775
Message ID:
01358799
Vues:
20
Put NODEFAULT to prevent focus from leaving the textbox.

>
>on a form, I've got a textbox that feeds a listbox, and I'd like to have focus remain in this textbox until the user leaves it blank.
>
>Here's the code from the lostfocus event
>
>
>if empty(this.value)
>  return
>endif  
>
>sele Ther
>seek alltrim(this.value)
>if !found()
>  wait window "Staff Code Not Found"
>else
>  ThisForm.LstStaff.AddListItem(alltrim(Ther.fname) + ' ' + alltrim(Ther.lname) + iif(empty(Ther.title),'',' ' + Ther.title))
>  thisform.lststaff.addlistitem(Ther.thid, thisform.lstStaff.NewItemID,2)
>  Thisform.lststaff.numberofelements = Thisform.lststaff.numberofelements + 1
>endif    
>this.value = ''
>return -1
>
>
>
>The "return -1" replaced the "this.setfocus()" call that didn't work either
>
>what simple, gads-I'm-gonna-feel-14-kinds-of-stupid thing am I missing?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform