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. pressing return in an edit control

pressing return in an edit control

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
10 Posts 7 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.
  • D Offline
    D Offline
    Desmo16
    wrote on last edited by
    #1

    Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application exits. Why ? How can i avoid that ? Thanx in advance, Desmo16.

    S N T H 4 Replies Last reply
    0
    • D Desmo16

      Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application exits. Why ? How can i avoid that ? Thanx in advance, Desmo16.

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      Set edit box style from resource editor as "Want return" or pEdit->ModifyStyle(0,ES_WANTRETURN); SaRath.
      _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


      My Blog | Understanding State Patte_

      S 1 Reply Last reply
      0
      • D Desmo16

        Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application exits. Why ? How can i avoid that ? Thanx in advance, Desmo16.

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        set the Want Return style for the edit control. if u dont want to ur application when the enter key is pressed, simply overide the OnOK() funtion in the dialog class. Inside that funtion do not call CDialog::OnOK().. nave

        N 1 Reply Last reply
        0
        • D Desmo16

          Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application exits. Why ? How can i avoid that ? Thanx in advance, Desmo16.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          Desmo16 wrote:

          Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application

          Also make you Edit Control Multiline!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

          1 Reply Last reply
          0
          • D Desmo16

            Hi all, When i run my MFC application, if i click in an edit control an press the "return" button the application exits. Why ? How can i avoid that ? Thanx in advance, Desmo16.

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            You can set Want return to true in property window from editbox_**


            **_

            whitesky


            1 Reply Last reply
            0
            • N Naveen

              set the Want Return style for the edit control. if u dont want to ur application when the enter key is pressed, simply overide the OnOK() funtion in the dialog class. Inside that funtion do not call CDialog::OnOK().. nave

              N Offline
              N Offline
              Naveen
              wrote on last edited by
              #6

              forgot to say set the multiline property(ES_MULTILINE) also to the edit box. nave

              1 Reply Last reply
              0
              • S Sarath C

                Set edit box style from resource editor as "Want return" or pEdit->ModifyStyle(0,ES_WANTRETURN); SaRath.
                _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


                My Blog | Understanding State Patte_

                S Offline
                S Offline
                see me
                wrote on last edited by
                #7

                I think this will not work.. try this.... simply overide the OnOK() and do not call CDialog::OnOK() OnOK(){} Else give Multiline property to edit box Dream bigger... Do bigger...Expect smaller aji -- modified at 7:14 Wednesday 12th July, 2006

                H S 2 Replies Last reply
                0
                • S see me

                  I think this will not work.. try this.... simply overide the OnOK() and do not call CDialog::OnOK() OnOK(){} Else give Multiline property to edit box Dream bigger... Do bigger...Expect smaller aji -- modified at 7:14 Wednesday 12th July, 2006

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #8

                  and OnCancel for Esc_**


                  **_

                  whitesky


                  1 Reply Last reply
                  0
                  • S see me

                    I think this will not work.. try this.... simply overide the OnOK() and do not call CDialog::OnOK() OnOK(){} Else give Multiline property to edit box Dream bigger... Do bigger...Expect smaller aji -- modified at 7:14 Wednesday 12th July, 2006

                    S Offline
                    S Offline
                    Sarath C
                    wrote on last edited by
                    #9

                    You can also aproach PretranslateMessage function SaRath.
                    _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


                    My Blog | Understanding State Patte_

                    F 1 Reply Last reply
                    0
                    • S Sarath C

                      You can also aproach PretranslateMessage function SaRath.
                      _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


                      My Blog | Understanding State Patte_

                      F Offline
                      F Offline
                      FarPointer
                      wrote on last edited by
                      #10

                      PretranslateMessage :omg: Regards, FarPointer Blog:FARPOINTER

                      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