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. Making CEdit behave properly in a CWnd

Making CEdit behave properly in a CWnd

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • P Offline
    P Offline
    panzerdivisionmarkus
    wrote on last edited by
    #1

    Hi, The subject may be a little off, but anyways... I wonder how I can make a CEdit behave "properly" in a CWnd. I want it to behave the way it does in a CDialog. When I place a CEdit in my CWnd, I can't use delete on it, I can't use tab to jump between ctrls and I can't select the text in a CEdit(yes, I've tried using setsel(0,-1)). So I wonder if anyone please can help make my CEdits behave like in a CDialog. Regards Markus

    B 1 Reply Last reply
    0
    • P panzerdivisionmarkus

      Hi, The subject may be a little off, but anyways... I wonder how I can make a CEdit behave "properly" in a CWnd. I want it to behave the way it does in a CDialog. When I place a CEdit in my CWnd, I can't use delete on it, I can't use tab to jump between ctrls and I can't select the text in a CEdit(yes, I've tried using setsel(0,-1)). So I wonder if anyone please can help make my CEdits behave like in a CDialog. Regards Markus

      B Offline
      B Offline
      basementman
      wrote on last edited by
      #2

      You need to implement the IsDialogMessage function in a PreTranslateMessage handler. See IsDialogMessage in the docs for more information.  onwards and upwards...

      P 1 Reply Last reply
      0
      • B basementman

        You need to implement the IsDialogMessage function in a PreTranslateMessage handler. See IsDialogMessage in the docs for more information.  onwards and upwards...

        P Offline
        P Offline
        panzerdivisionmarkus
        wrote on last edited by
        #3

        If I understood you right, I'm supposed to override the PreTranslateMessage handler in my CWnd, and call the IsDialogMessage from there, like this: BOOL CMyWnd::PreTranslateMessage( msg ) { if( IsDialogMessage( msg ) ) return TRUE; else return CWnd::PreTranslateMessage( msg ); } Sadly it didn't work, I still can't use delete or tab in my CEdit. And the messages doesn't come to the function, at least not what I can see. Did I misunderstood you, or have I done something wrong?

        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