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. Dynamic CEdit

Dynamic CEdit

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • D Offline
    D Offline
    Dave_
    wrote on last edited by
    #1

    I am trying to create a CEdit dynamically, and placing it in a CPropertyPage. What I end up with is a CEdit with what I think is the large system font, and no 3D border. Here's how I'm creating it (I used the same settings as other CEdit's not created dynamically): m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(),OCTAL_EDIT); m_pOctalEdit->ModifyStyleEx(0,WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY); Any idea why the 3D border is not there, and the font is different? Thank you for your help.

    Y 1 Reply Last reply
    0
    • D Dave_

      I am trying to create a CEdit dynamically, and placing it in a CPropertyPage. What I end up with is a CEdit with what I think is the large system font, and no 3D border. Here's how I'm creating it (I used the same settings as other CEdit's not created dynamically): m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(),OCTAL_EDIT); m_pOctalEdit->ModifyStyleEx(0,WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY); Any idea why the 3D border is not there, and the font is different? Thank you for your help.

      Y Offline
      Y Offline
      Yuri Kreinin
      wrote on last edited by
      #2

      m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(), OCTAL_EDIT); 1. What's that? Whose parent shoud be a parent of your editbox? 2. Use ModifyStyleEx(0, WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); and remove WS_VISIBLE style from Create. 3. I think that the much better approach is to create edit control with CreateEx, so you can specify extended window styles upon creation. 4. To show a correct font - get parent's font and set it to the control window.

      D 1 Reply Last reply
      0
      • Y Yuri Kreinin

        m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(), OCTAL_EDIT); 1. What's that? Whose parent shoud be a parent of your editbox? 2. Use ModifyStyleEx(0, WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); and remove WS_VISIBLE style from Create. 3. I think that the much better approach is to create edit control with CreateEx, so you can specify extended window styles upon creation. 4. To show a correct font - get parent's font and set it to the control window.

        D Offline
        D Offline
        Dave_
        wrote on last edited by
        #3

        Thank you for the reply. It looks like the SWP_DRAWFRAME is waht I was missing. To answer your question, the GetParent() will return the CPropertyPage (as mentioned in the initial posting). Thanks again, Dave

        Y 1 Reply Last reply
        0
        • D Dave_

          Thank you for the reply. It looks like the SWP_DRAWFRAME is waht I was missing. To answer your question, the GetParent() will return the CPropertyPage (as mentioned in the initial posting). Thanks again, Dave

          Y Offline
          Y Offline
          Yuri Kreinin
          wrote on last edited by
          #4

          Regarding to GetParent, in member of what class are you calling to CEdit::Create?

          D 1 Reply Last reply
          0
          • Y Yuri Kreinin

            Regarding to GetParent, in member of what class are you calling to CEdit::Create?

            D Offline
            D Offline
            Dave_
            wrote on last edited by
            #5

            A CStatic derived class that is a child of the CPropertyPage. Things are working fine now, thanks again.

            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