Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want to lock keyboard
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01361245
Message ID:
01362422
Vues:
11
I did once something like that using checking the data entry speed.
I figured the only difference between keyboard entry or barcode scanner is the speed in which the barcode is scanned as compared to the speed a person can type that number

The method checks the speed in which the entire number is entered. If the process takes too long I empty the textbox value. So if somebody tries to enter the number using the keyboard he will never succeed because the process takes too long and after each entry the textbox gets empty.

Of course you have to disable CTRL+V also.

I don't have the code anymore, but what I did was to put the method in the keypress. When the textbox is empty I store the time and then I check each keypress how many milliseconds have past since the first press. If that is more than XX milliseconds then I reset the textbox value to empty and start from the beginning.

I hope that helps.

>Hi to all
>I want to lock the key board on a form and use the barcode scanner for input i write the key press procedure
>DO case
>CASE nkeycode=27
>thisform.release()
>CASE nkeycode=5
>MESSAGEBOX("Key boardnot allowed",16,"Validation Error")
>thisform.text1.Value=""
>thisform.Refresh()
>RETURN
>CASE nkeycode equal to greater than 48 AND nkeycode equal to lesser than 123
>MESSAGEBOX("Key boardnot allowed",16,"Validation Error")
>thisform.text1.Value=""
>thisform.Refresh()
>RETURN
>ENDCASE
>
>these command also lock the bar code scanner
>
>any suggestion form you.
>
>thanks
>
>Rashid Mehmood
Christian Isberner
Software Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform