Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Wait until user finish typing

Wait until user finish typing

Scheduled Pinned Locked Moved C#
questiondatabasehelp
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    biop codeproject
    wrote on last edited by
    #1

    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.

    A P L J P 6 Replies Last reply
    0
    • B biop codeproject

      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.

      A Offline
      A Offline
      AmitGajjar
      wrote on last edited by
      #2

      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)

      1 Reply Last reply
      0
      • B biop codeproject

        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.

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • B biop codeproject

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • B biop codeproject

            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.

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • B biop codeproject

              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.

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • B biop codeproject

                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.

                B Offline
                B Offline
                biop codeproject
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups