Solved

Using Textboxes and buttons with Barcode Scanners

Posted on 2016-08-30
3
72 Views
Last Modified: 2016-09-08
I have a ASP.net application that uses VB.net for the code behind.

The purpose of this application is to take input from a barcode scanner and input it into a database.

There are 4 textboxes and then a button that write the data to the database.

The problem that I am having is that the barcode scanners are used for another application and that application requires that the barcode scanners record a line feed carriage return each time a value is scanned.

The line feed, carriage return causes the button to execute because it has the focus.

Here is what I need to happen:

1) Barcode is scanned into textbox1 - the application should record the data in textbox #1 and then change the focus to textbox #2.
2) Barcode is scanned into textbox2 - the application should record the data in textbox #2 and then change the focus to textbox #3
3) Barcode is scanned into textbox3 - the application should record the data in textbox #3 and then change the focus to textbox #4
4) Data will be hand keyed into textbox4 - the application will then execute the click button event to write the data.

How can I do #1 thru #4 above taking into account the barcode scanner will have a carriage return line feed each time a value is scanned?
0
Comment
Question by:yonbret
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41777922
from what I remember (my last barcode scanner project was about 10 years ago), even if a code is scanned, you are still receiving the KeyPress/KeyDown/KeyUp events right? If that is still the case, you can handle the CR code to focus on another control
0
 
LVL 33

Expert Comment

by:ste5an
ID: 41778024
When the other application does not use a start marker for the barcode transmission, then it is pretty hard.

I have to guess as it is a web application. The basic approach: hook into all keypress events. Then when a barcode start marker is sent, copy each character into a buffer and discard the bubbling to the control until you have received the barcode end marker. Then send the barcode from the buffer to the correct control.
0
 
LVL 6

Expert Comment

by:tncode
ID: 41778098
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question