Click here to Skip to main content
12,625,166 members (38,592 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi
I am building a inventory system in which I require a barcode interface. In my program I am thinking to keep a textbox in which the cursor is focused and when the barcode is scanned the corresponding data of the code in the database should be displayed in the database in the same form.

How can I manage the event handling of barcode entry? I am using Visual Studio 2008.

Can anyone please help me?

Thank you.

Arpan
Posted 12-Oct-11 5:30am
amsainju1.3K
Updated 12-Oct-11 6:04am
Nueman9.7K
v2
Comments
Albert Holguin 12-Oct-11 11:11am
   
This question may be a bit too vague... expect vague answers...
amsainju 12-Oct-11 12:23pm
   
ya maybe i am not a pro..just learning so can't properly explain sorry... but i got my answer

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Do you noticed when we scan a barcode to computer it will print the character string and move the cursor to next line...,
ie,One enter is pressing after printing barcode string in text box, You can check this from keydown event


private void textBox1_KeyDown(object sender, KeyEventArgs e)
       {
 
           if (e.KeyCode == Keys.Enter)
           {
               //Type your code for getting data from database
           }
 
       }
  Permalink  
v3
Comments
amsainju 12-Oct-11 11:53am
   
thanks pal....u solved my big problem...thanks alot...
DaveyM69 12-Oct-11 18:43pm
   
Most barcode scanners I have come across can be programmed to use a different or no suffix. All the ones in my company for example are programmed to send TAB after the scanned code.
Arun Kumar K S 15-Oct-11 2:00am
   
Use TextBox2.Focus() method
amsainju 14-Oct-11 5:51am
   
how can we program the barcode for different key?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 12 Oct 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100