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. How to trap Enter key pressed in textbox

How to trap Enter key pressed in textbox

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 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.
  • V Offline
    V Offline
    viral_umang hotmail com
    wrote on last edited by
    #1

    Hi! I've created a single dialog based application using MFC application wizard. I am using a textbox in that dialogbox now i want to trap when Enter key pressed in textbox,but when i pressed enter key the application ends.why? and what is the solution? Viral Joshi

    D 1 Reply Last reply
    0
    • V viral_umang hotmail com

      Hi! I've created a single dialog based application using MFC application wizard. I am using a textbox in that dialogbox now i want to trap when Enter key pressed in textbox,but when i pressed enter key the application ends.why? and what is the solution? Viral Joshi

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

      viral_umang@hotmail.com wrote:

      I am using a textbox in that dialogbox now i want to trap when Enter key pressed in textbox...

      Does the edit control have the ES_WANTRETURN style?

      viral_umang@hotmail.com wrote:

      ...but when i pressed enter key the application ends.why?

      See here.


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

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

      V 1 Reply Last reply
      0
      • D David Crow

        viral_umang@hotmail.com wrote:

        I am using a textbox in that dialogbox now i want to trap when Enter key pressed in textbox...

        Does the edit control have the ES_WANTRETURN style?

        viral_umang@hotmail.com wrote:

        ...but when i pressed enter key the application ends.why?

        See here.


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

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

        V Offline
        V Offline
        viral_umang hotmail com
        wrote on last edited by
        #3

        Thanks David. This is working fine.Thank you for coordination. Viral Joshi.

        D 1 Reply Last reply
        0
        • V viral_umang hotmail com

          Thanks David. This is working fine.Thank you for coordination. Viral Joshi.

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

          viral_umang@hotmail.com wrote:

          Thank you for coordination.

          You're welcome. I'm glad I could cooperate with you. ;)


          "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
          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