Wait until user finish typing
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
Hi, Can't you use LostFocus event, when user finish with typing and press TAB key it will search for the result.
Thanks -Amit Gajjar (MinterProject)
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
I second Amit's suggestion of using the Leave event. If for some reason your requirements are not going to allow you to ( I don't see why ), you could always just have the TextChanged event do nothing until the length of the entered text is greater than or equal to 10.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
Store the current time in a class level field in the TextChanged event. Run a timer every 1 second (or 2 seconds if you prefer) and inside the Timer's Elapsed event handler (or Tick event handler depending on which Timer you use) check when the last character was typed, if it is more than 1 second, it's time to do your stuff.
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
biop.codeproject wrote:
I want the program to automatically scan the database and return information about that number.
Really bad idea. How exactly are you going to deal with ALL of the following scenarios if you attempt to guess when they are done? 1. User types 120 words a minute which is 2 characters a second. So it takes them at most 6 seconds to type the number. 2. Same EXACT user as above. But they are reading the number from a piece of paper and when they get to the 6th digit they can't read it. So they go down the hallway to ask another person what it is. And they don't return for 15 minutes. 3. The user is physically disabled and it takes them 3 minutes to type those 12 digits with different periods of delay between each character. The only solution is that the user must take some action AFTER they are finished typing. Like pushing an ok button, hitting return, or tabbing to another field.
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
Let's break your problem down here. You have a sequence of some length that you don't know. The user enters numbers into a TextBox, again you don't know how long this sequence is. How do you know when the last character is entered? Your user experience is going to have to be one of: User enters sequence and leaves the field - at which point you retrieve the matching entry and display it if found. User enters sequence and as each character is pressed, possible matches are retrieved from the database and displayed (a standard autocomplete). The user can select one of these elements and the text sequence is updated. User enters sequence and clicks some form of button to trigger the retrieval. Without knowing how long this sequence is going to be, you cannot do anything other.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
I have a program which allows user to input a sequence of numbers. The length of the number is not fixed. It could be 10, 12, or whatever length. After the user has finished inputting the number, I want the program to automatically scan the database and return information about that number. Question is how? If I use TextChanged() event, it is called whenever every character is typed. I only want to know when the last character is typed. Please help. I have spent many days on this already.
Thanks for all your input. Actually yes that is true, without knowing the number of characters to be entered in advance, it could be an impossible task. Actually the input is from two devices. One is from scanning RFID (a 24 character string) and another is from barcode (this is harder as I don't know the predefined limit). Lucky I can capture the event that the RFID scanner button is pressed and the barcode scanner button is pressed. Now I am integrating the two sample programs together. Hope it works. And I consider this question is closed. Thanks.