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 7511389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:31:57+00:00 2026-05-29T23:31:57+00:00

I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional.

  • 0

I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional. There is a textbox that I use in the program that when the focus is placed on it will take the data encoded on a magnetic striped card such as a driver’s license or any card that has this kind of data encoded magnetically. Very simple to get the data as the program takes all of it upon the swipe without having to do really anything, however, the problem is that I don’t know which declaration to use when the swipe has stopped – or the last character has been entered. Currently I am using TextBox1_textChanged as my declaration, but that is called every time each character is put into the text box. When you are swiping, this is an ongoing process until the last character is put in. So if I have a magentic card with 10 characters in it, this method will be called 10 times. Is there a declaration that I can use that only fires off whent he swipe has loaded all of the characters or some kind of loop that I can incorporate?
Thanks!

  • 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-29T23:31:59+00:00Added an answer on May 29, 2026 at 11:31 pm

    In short, the answer is no – All the card reader does is present itself to the computer as a special keyboard – when you swipe the card, it “types”.

    Because of this, you don’t usually get any additional information about the state (failed swipe, swipe complete, etc.)

    Some card readers will perform a carriage return at the end of the data. Depending on your circumstance, you may know the data will always be the same length.

    In either case, you’ll still need to hook the TextBox.TextChanged event – just have a little bit of logic which checks if the key press is enter/the textbox text is the correct length.

    (NB: If checking for an Enter or another key, it will probably be easier to use the TextBox.KeyDown event. Have a look at the e variable which contains information about the key being “pressed”)

    As mentioned in the comments on the OP by @Reafidy, the last alternative which is guaranteed to work but a bit messier to implement is to use a timer which will fire your method after n milliseconds without a change to the text.

    Incidentally, I’m assuming you mean VB.Net not VBA (VB for Applications – eg Excel Macros). I’ve edited the tags accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic Visual Basic Program that I created in Visual Studio
I have created a custom control using VB.NET in Visual Studio 2008 that gives
I have created my first dll using c# and visual studio 2010. I am
I have created a simple Visual Studio Express 2010 C++ project using GLUT and
I have created an installer for MyProgram using the Visual Studio Installer (Visual Studio
I have created a new Visual Studio Setup Project that uses the output of
I have created a minidump file using the Visual Studio 2008 C++ debugger (Debug
I have created a C# web service using visual studio to stop the windows
I working working with Visual Basic 2010 Express. I have a DataGridView that is
I have created a simple WPF test program, based on what Visual Studio gives

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.