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 created button Resizing [modified]

Dynamic created button Resizing [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 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
    shiv nand
    wrote on last edited by
    #1

    I have created buttons dynamically eg: CButton* m_btn = new CButton(); m_btn->Create("ICON", BS_FLAT|WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_ICON, CRect(0,0,80,80, 8001); after creating button ,Resizing it, CButton *btn=(CButton *)GetDlgItem(8001); btn->SetWindowPos(0,0,0,50,50,SWP_FRAMECHANGED | SWP_NOZORDER ) ok it works fine i can see the button with new size on dialog . But when i save this and open the dialog the button is not displaying on the dialog it is hidden so please help me what is worng. saving size (top,left,right,bottom) to the file and later open but the Resized button is not displaying other buttons are visible. above peace of code is just example i given not actual code. -- Modified Thursday, February 18, 2010 4:53 AM

    C B 2 Replies Last reply
    0
    • S shiv nand

      I have created buttons dynamically eg: CButton* m_btn = new CButton(); m_btn->Create("ICON", BS_FLAT|WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_ICON, CRect(0,0,80,80, 8001); after creating button ,Resizing it, CButton *btn=(CButton *)GetDlgItem(8001); btn->SetWindowPos(0,0,0,50,50,SWP_FRAMECHANGED | SWP_NOZORDER ) ok it works fine i can see the button with new size on dialog . But when i save this and open the dialog the button is not displaying on the dialog it is hidden so please help me what is worng. saving size (top,left,right,bottom) to the file and later open but the Resized button is not displaying other buttons are visible. above peace of code is just example i given not actual code. -- Modified Thursday, February 18, 2010 4:53 AM

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

      What do you mean bv "i save this"?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <

      1 Reply Last reply
      0
      • S shiv nand

        I have created buttons dynamically eg: CButton* m_btn = new CButton(); m_btn->Create("ICON", BS_FLAT|WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_ICON, CRect(0,0,80,80, 8001); after creating button ,Resizing it, CButton *btn=(CButton *)GetDlgItem(8001); btn->SetWindowPos(0,0,0,50,50,SWP_FRAMECHANGED | SWP_NOZORDER ) ok it works fine i can see the button with new size on dialog . But when i save this and open the dialog the button is not displaying on the dialog it is hidden so please help me what is worng. saving size (top,left,right,bottom) to the file and later open but the Resized button is not displaying other buttons are visible. above peace of code is just example i given not actual code. -- Modified Thursday, February 18, 2010 4:53 AM

        B Offline
        B Offline
        BIJU Manjeri
        wrote on last edited by
        #3

        Instead of that, you can try this one.. CWnd* m_pWndButton = new CWnd; m_pWndButton ->Create(_T("BUTTON"), _T("Click Me"), WS_CHILD | WS_VISIBLE, CRect(0, 0, 20, 20), this, 0);

        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