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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. edit control

edit control

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
5 Posts 3 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.
  • K Offline
    K Offline
    kumar_mk
    wrote on last edited by
    #1

    I would like to know whether the same Edit Control can handle two types of notification messages, like my requirement is i have an edit control in my dialog box which takes the ID of an voucher, now i have to fill this edit control by two ways 1st> is to manually enter the Voucher ID and press ENTER key (in the keyboard) for the Validation to take place, for this i can handle PreTranslateMessage, VK_RETURN . 2nd> is to scan the Voucher with the Barcode Reader, after scanning, my edit control is populated with the Voucher ID and the validation should happen without entering any Key or doing any action, for this case i can handle ON_EN_CHANGE . my problem is in the 1st case when i enter the 12 digit voucher ID (remember i did not press the ENTER key), the validation is done, since i am also handling the ON_EN_CHANGE message for supporting the 2nd case. how to handle both these cases for the same EDIT control?? thanx in advance kumar_windows

    L D 2 Replies Last reply
    0
    • K kumar_mk

      I would like to know whether the same Edit Control can handle two types of notification messages, like my requirement is i have an edit control in my dialog box which takes the ID of an voucher, now i have to fill this edit control by two ways 1st> is to manually enter the Voucher ID and press ENTER key (in the keyboard) for the Validation to take place, for this i can handle PreTranslateMessage, VK_RETURN . 2nd> is to scan the Voucher with the Barcode Reader, after scanning, my edit control is populated with the Voucher ID and the validation should happen without entering any Key or doing any action, for this case i can handle ON_EN_CHANGE . my problem is in the 1st case when i enter the 12 digit voucher ID (remember i did not press the ENTER key), the validation is done, since i am also handling the ON_EN_CHANGE message for supporting the 2nd case. how to handle both these cases for the same EDIT control?? thanx in advance kumar_windows

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      You are putting operations in an edit control that don't belong there. Validation of the VoucherID should be isolated from any edit control. This way you can validate the data when scanned then put it in the edit control.

      led mike

      K 1 Reply Last reply
      0
      • L led mike

        You are putting operations in an edit control that don't belong there. Validation of the VoucherID should be isolated from any edit control. This way you can validate the data when scanned then put it in the edit control.

        led mike

        K Offline
        K Offline
        kumar_mk
        wrote on last edited by
        #3

        hi mike thnkx, pls tell me whether i can handle 2 different messages for the same edit control

        thanx in advance kumar_windows

        L 1 Reply Last reply
        0
        • K kumar_mk

          hi mike thnkx, pls tell me whether i can handle 2 different messages for the same edit control

          thanx in advance kumar_windows

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          kumar_windows wrote:

          pls tell me whether i can handle 2 different messages for the same edit control

          fine... yes you can :rolleyes:

          led mike

          1 Reply Last reply
          0
          • K kumar_mk

            I would like to know whether the same Edit Control can handle two types of notification messages, like my requirement is i have an edit control in my dialog box which takes the ID of an voucher, now i have to fill this edit control by two ways 1st> is to manually enter the Voucher ID and press ENTER key (in the keyboard) for the Validation to take place, for this i can handle PreTranslateMessage, VK_RETURN . 2nd> is to scan the Voucher with the Barcode Reader, after scanning, my edit control is populated with the Voucher ID and the validation should happen without entering any Key or doing any action, for this case i can handle ON_EN_CHANGE . my problem is in the 1st case when i enter the 12 digit voucher ID (remember i did not press the ENTER key), the validation is done, since i am also handling the ON_EN_CHANGE message for supporting the 2nd case. how to handle both these cases for the same EDIT control?? thanx in advance kumar_windows

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

            Handling the ON_EN_CHANGE notification is the way I'd handle this. In the handler function, don't enable the OK button if an invalid voucher has been entered/scanned into the edit control.


            "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

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

            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