Dynamic created button Resizing [modified]
-
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
-
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
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. <
-
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
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);