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. [solved]RichEdit control in Dialog: "Retrun" does'nt Work !

[solved]RichEdit control in Dialog: "Retrun" does'nt Work !

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiohelpquestion
6 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.
  • S Offline
    S Offline
    stephen_young
    wrote on last edited by
    #1

    Hi everybady. I Inserted a richedit control in a Dialog.When I typed string in richedit control I found the control didnt response RETURN key.There was not problem in CRichEditView in single document app. I think perhaps the dialog would process the RETURN down message,and the richedit control had no chance to response it. I used "ModifyStyle(0,ES_WANTRETURN)" set richedit control's style but this didnt resolve the problem. What's the different between richedit control in dialog and document-view app ? Thanks. :sigh: Thanks everybody,I found I must set ES_WANTRETURN in visual studio ,

    ModifyStyle(0,ES_WANTRETURN)

    in the OnInitDialog() can't modify the style. I wonder whether the RichEditCtrl's style must be set when create.

    M C 2 Replies Last reply
    0
    • S stephen_young

      Hi everybady. I Inserted a richedit control in a Dialog.When I typed string in richedit control I found the control didnt response RETURN key.There was not problem in CRichEditView in single document app. I think perhaps the dialog would process the RETURN down message,and the richedit control had no chance to response it. I used "ModifyStyle(0,ES_WANTRETURN)" set richedit control's style but this didnt resolve the problem. What's the different between richedit control in dialog and document-view app ? Thanks. :sigh: Thanks everybody,I found I must set ES_WANTRETURN in visual studio ,

      ModifyStyle(0,ES_WANTRETURN)

      in the OnInitDialog() can't modify the style. I wonder whether the RichEditCtrl's style must be set when create.

      M Offline
      M Offline
      Mattias G
      wrote on last edited by
      #2

      I think you're absolutely right on that, the dialog eats your return key press in IsDialogMessage. If you're using a dialog template you could try modifing the style in the resource editor instead of in your code. /M

      S 1 Reply Last reply
      0
      • S stephen_young

        Hi everybady. I Inserted a richedit control in a Dialog.When I typed string in richedit control I found the control didnt response RETURN key.There was not problem in CRichEditView in single document app. I think perhaps the dialog would process the RETURN down message,and the richedit control had no chance to response it. I used "ModifyStyle(0,ES_WANTRETURN)" set richedit control's style but this didnt resolve the problem. What's the different between richedit control in dialog and document-view app ? Thanks. :sigh: Thanks everybody,I found I must set ES_WANTRETURN in visual studio ,

        ModifyStyle(0,ES_WANTRETURN)

        in the OnInitDialog() can't modify the style. I wonder whether the RichEditCtrl's style must be set when create.

        C Offline
        C Offline
        Code o mat
        wrote on last edited by
        #3

        Does your rich edit have the multiline style?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

        S 1 Reply Last reply
        0
        • M Mattias G

          I think you're absolutely right on that, the dialog eats your return key press in IsDialogMessage. If you're using a dialog template you could try modifing the style in the resource editor instead of in your code. /M

          S Offline
          S Offline
          stephen_young
          wrote on last edited by
          #4

          Mattias G wrote:

          you could try modifing the style in the resource editor instead of in your code

          Thanks. I wonder which style I should modify in the resource editor.

          1 Reply Last reply
          0
          • C Code o mat

            Does your rich edit have the multiline style?

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

            S Offline
            S Offline
            stephen_young
            wrote on last edited by
            #5

            Code-o-mat wrote:

            Does your rich edit have the multiline style?

            I added the multiline style.

            C 1 Reply Last reply
            0
            • S stephen_young

              Code-o-mat wrote:

              Does your rich edit have the multiline style?

              I added the multiline style.

              C Offline
              C Offline
              Code o mat
              wrote on last edited by
              #6

              Did it help?

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

              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