Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keeping focus in a field
Message
De
31/10/2008 15:48:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Keeping focus in a field
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01358775
Message ID:
01358775
Vues:
74
Hi all

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?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform