SDI Form Resize
-
hi, I am using a SDI FormView-derived Form. I am dynamically creating controls which are placed on the form. I need to resize the vertical size of the form as I fill it. I have placed a scroll bar on the form. I managed to do the following: void CStocks: nSize(UINT nType, int cx, int cy) { CFormView: nSize(nType, cx, cy); CRect txtRect, clientRect; GetWindowRect(txtRect); ScreenToClient(txtRect); GetWindowRect(clientRect); CStatic caramba[50]; CString g; for (int i=0;i<50;i++) { g.Format("%d", i); caramba[i].Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this); txtRect.bottom += 50; } MoveWindow(txtRect); As you can see I created quite a few objects just to test the scroll facility. The Scroll Bar appears but my Toolbar and Statusbar disappeared. Can anyone help me with an example or correction of my errors. Thanking you in anticipation. Rui
-
hi, I am using a SDI FormView-derived Form. I am dynamically creating controls which are placed on the form. I need to resize the vertical size of the form as I fill it. I have placed a scroll bar on the form. I managed to do the following: void CStocks: nSize(UINT nType, int cx, int cy) { CFormView: nSize(nType, cx, cy); CRect txtRect, clientRect; GetWindowRect(txtRect); ScreenToClient(txtRect); GetWindowRect(clientRect); CStatic caramba[50]; CString g; for (int i=0;i<50;i++) { g.Format("%d", i); caramba[i].Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this); txtRect.bottom += 50; } MoveWindow(txtRect); As you can see I created quite a few objects just to test the scroll facility. The Scroll Bar appears but my Toolbar and Statusbar disappeared. Can anyone help me with an example or correction of my errors. Thanking you in anticipation. Rui
//inside your view
GetParentFrame()->RecalcLayout();
ResizeParentToFit(FALSE);Maybe one of these two sentences (or both combined) gives some results. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo