Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Absorbing a key
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01228355
Message ID:
01228631
Vues:
17
>You mention clearing properties in your initial entry...what properties? Also, you have a property that you seem to have defined that receives the ActiveControl. I don't have that property. Do I have to?

Dug,
In the 1st example I just copied some working code from our form.
The references to:
.CurrentPlace = .ActiveControl
.barcode = .t.  && flag for any valids
are used in our form to tell the valid where the input
came from and to return focus to the original text box
when done. You don't need them.

The thing that needs to be cleared is the input text box.
If someone has left something in the input text box, (say they started
to enter the code then decided to use the barcode instead,
or the didn't get a good reading the 1st time) then the
barcode value would be added to whatever was there resulting
in a bad code. Thus the code:
.txtEmplId.Value = ''
Put this code in the form keypress method.
Be sure to Set the form keypreview = .T. or this won't work.

The NoDefault will remove the ~ then the rest of the
barcoded input will go to the textbox you set focus to.

Use the name of your text box that gets the employee
id in place of .txtEmplId
If nKeyCode = 126 &&  BARCODE ~
  * user has scanned a barcode
  With Thisform
    .txtEmplId.Value = ''
    .txtEmplId.SetFocus()
  EndWith
  NoDefault
EndIf
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform