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 / C++ / MFC
  4. Edit control

Edit control

Scheduled Pinned Locked Moved C / C++ / MFC
databasealgorithmsquestion
9 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.
  • J Offline
    J Offline
    Jarley D G
    wrote on last edited by
    #1

    Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    P M T D 4 Replies Last reply
    0
    • J Jarley D G

      Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

      --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

      P Offline
      P Offline
      Programm3r
      wrote on last edited by
      #2

      Hi, I'm not sure what the appropriate events / method is to use but in JavaScript I use onKeyPress and filtering thought the database. Can't think of anything else.... Hope this might spark something in your brain .... lol .... :)

      The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r

      1 Reply Last reply
      0
      • J Jarley D G

        Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

        --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        EN_CHANGE

        J M 2 Replies Last reply
        0
        • M Mark Salsbery

          EN_CHANGE

          J Offline
          J Offline
          Jarley D G
          wrote on last edited by
          #4

          thx :)

          --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

          1 Reply Last reply
          0
          • J Jarley D G

            Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

            --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            can't you try both and see which one fits you best ? also, reading the MSDN about those events may help !


            You don't know where to start ? ask a good friend

            [VisualCalc 3.0][Flags Beginner's Guide]

            J 1 Reply Last reply
            0
            • T toxcct

              can't you try both and see which one fits you best ? also, reading the MSDN about those events may help !


              You don't know where to start ? ask a good friend

              [VisualCalc 3.0][Flags Beginner's Guide]

              J Offline
              J Offline
              Jarley D G
              wrote on last edited by
              #6

              Im on it testing both, just wanted to know a better way. thx

              --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

              1 Reply Last reply
              0
              • M Mark Salsbery

                EN_CHANGE

                M Offline
                M Offline
                Maximilien
                wrote on last edited by
                #7

                it will work but might not be practical if the search in the DB takes a long time. user types "a" waits for a few seconds, user types "c" waits for a few seconds, user types backspace because he wanted to type "v" instead, waits a few seconds, user types "v" ...


                Maximilien Lincourt Your Head A Splode - Strong Bad

                M 1 Reply Last reply
                0
                • J Jarley D G

                  Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

                  --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  jarleydg wrote:

                  So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ?

                  The former is sent before the control us updated, whereas the latter is sent after.


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  1 Reply Last reply
                  0
                  • M Maximilien

                    it will work but might not be practical if the search in the DB takes a long time. user types "a" waits for a few seconds, user types "c" waits for a few seconds, user types backspace because he wanted to type "v" instead, waits a few seconds, user types "v" ...


                    Maximilien Lincourt Your Head A Splode - Strong Bad

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #9

                    Maximilien wrote:

                    it will work but might not be practical if the search in the DB takes a long time.

                    I agree. That's why I chose EN_CHANGE - at least the user will see the character typed before it goes off and searches :)

                    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