Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In my application i want to use Barcode Scanner which scan barcode and display that number to label. i dont understand how to use it in my application.

after loading application i scan barcode and display it in label.but how application know that scanner read barcode.

What I have tried:

not started application thinking on that how to use it in application.
Posted
Updated 31-Mar-16 22:12pm

1 solution

You have three options:

1) A USB-barcode scanner will have keyboard emulation. Meaning, a scanned barcode will appear at your current input cursor as if you've typed the number/string manually into a keyboard. So you could just have a text input control and just don't bother if it's a keyboard or barcode scanner where the input comes from. Advantage: Easiest to set up. Disadvantage: You have to take care that the text input control always has the input focus when the user might want to scan a barcode.

2) The manufacturer of your barcode scanner MIGHT have an API for it. For low budget scanners there are most often none. Advantage: No trouble with an input control. Disadvantage: You're limiting your application to one type (or certain types) of barcode scanner. More work than for 1)

3) Use the Windows "Raw Input API". Explained and demonstrated in this CodeProject article: Using Raw Input from C# to handle multiple keyboards[^]
Advantage: No trouble with an input control. No trouble with vendor specific API's. Disadvantage: More work than for 1)
 
Share this answer
 

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