Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3633806
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:41:58+00:00 2026-05-19T00:41:58+00:00

I have a barcode scanner which reads the string of the barcode and displays

  • 0

I have a barcode scanner which reads the string of the barcode and displays in the active text box.
The issue I am having, is that I need that barcode to be used as soon as its scanned (no user “ok” button).

When I do the Text Changed event, it fires as soon as the first character of the barcode is entered into the text box. (i.e if the barcode is 123r54122, it fires with ‘1’ in the text box).

There is no consistent end character to the barcode, or standard length. So how would I go about firing a method when the WHOLE string has been read in?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:41:59+00:00Added an answer on May 19, 2026 at 12:41 am

    You can verify text length (I think it is constant for bar codes).
    E.g. subscribe to TextChange event and if text length = barCodeLength then raise Scanned event.

    If bar code has variable length you can try something like this:
    1) define

    private Timer _timer;
    private DateTime _lastBarCodeCharReadTime;
    

    2) initialize timer

    _timer = new Timer();
    _timer.Interval = 1000;
    _timer.Tick += new EventHandler(Timer_Tick);
    

    3) add handler

    private void Timer_Tick(object sender, EventArgs e)
    {
        const int timeout = 1500;
        if ((DateTime.Now - _lastBarCodeCharReadTime).Milliseconds < timeout)
            return;
    
        _timer.Stop();
        // raise Changed event with barcode = textBox1.Text            
    }
    

    4) in TextChanged event handler add this

    private void textBox1_TextChanged(object sender, EventArgs e)
    {    
        _lastBarCodeCharReadTime = DateTime.Now;
        if (!_timer.Enabled)
            _timer.Start();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that reads in a barcode from a USB scanner. I
I have a barcode scanner (which acts like a keyboard) and of course I
On one computer I have both a regular keyboard and a barcode scanner which
I have an application that uses a barcode scanner. I want to be able
I have an app in which i use zxing barcode scanner to scan qr
I have an activity which behaves like this: A barcode scanner is called via
Our reception has a barcode scanner plugged into a Macbook Mini, which is used
I have a barcode scanner and laptop (ofcourse :)), I'm looking for simple event
I have a barcode scanner(Symbol-ls2208) but i dont know how to read information from
i am new in this Field.I have implemented BarCode Scanner.I have got the Proper

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.