Click here to Skip to main content
16,012,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,

how can i control the barcode scanner to send data only into its Barcodtext.text
suppose i have 3 input textboxs arround the form when user scann an item i just need to send barcode data into Barcodtext even if user is focus in another textbox .

What I have tried:

i tried alot of codes about this but i failed
Posted
Updated 5-Dec-18 20:43pm

1 solution

Barcode scanners nearly all ship set to act as a keyboard, so when you scan a code the characters are fed as keystrokes into Windows keyboard queue. Unfortunately, Windows does not record the source, so once the scan is started you cannot tell if it was typed on one of the (many possible) keyboard devices attached to the system, or scanned.

To get round this, most scanners can be set to provide "lead in" and "tail out" sequences that you can identify in your software to say "barcode coming", and "barcode ended" and divert the data anywhere you need to.

But ... each manufacturer (and sometimes even model) needs a different process to configure these. You will have to speak to the manufacturer of your specific scanner to find out how to set the sequences.
 
Share this answer
 
Comments
Ralf Meier 6-Dec-18 4:32am    
Additionally :
Some Barcode-Scanners also allow to write it's data into a file at a special location. Perhaps your Scanner is able to do this.
In this case you could look cyclic if the file (or it's timestamp) is changed and you can read it's data exactly into the location you want.
This could be done by a Control or a Background-Thread ...
Member 12919915 6-Dec-18 8:18am    
thanks alot for your help
OriginalGriff 6-Dec-18 8:23am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900