CPropertySheetView
Robert Elmer -- relmer@bev.net Sunday, March 16, 1997 Environment: VC 5.0, NT 4.0 How does one resize the main frame to exactly fit a view, taking into account the size of the toolbar, titlebar, menu bar, etc? I'm using the CPropertySheetView class (found in the mfc-l archives) in an sdi app. At the end of CPropertySheetView::Create, the parent frame is resized to fit the property sheet exactly. Here's the code: // Adjust initial size of frame to match the property sheet CRect rectIdeal; m_propSheet.GetWindowRect (rectIdeal); CFrameWnd * pFrame = GetParentFrame(); ASSERT_VALID (pFrame); // Calc frame size given pFrame->CalcWindowRect (rectIdeal); // client pFrame->SetWindowPos (NULL, 0, 0, rectIdeal.Width(), rectIdeal.Height(), SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); Currently, I'm just adding 75 to rectIdeal.Height() when I call SetWindowPos, but I'm sure there's a real solution out there somewhere. Thanks, Rob
Doug Brubacher -- Doug_Brubacher@compuware.com Wednesday, March 19, 1997 Advanced? MFC? See int GetSystemMetrics( int nIndex // system metric or configuration setting to retrieve ); SM_CYCAPTION Height, in pixels, of normal caption area. SM_CYMENU Height, in pixels, of single-line menu bar. etc. Regards, Doug Brubacher Doug Brubacher@compuware.com
Robert Elmer -- relmer@bev.net Sunday, March 23, 1997 But what about the toolbar and status bar? ---------- > From: Doug Brubacher> To: mfc-l@netcom.com > Subject: RE: CPropertySheetView > Date: Wednesday, March 19, 1997 7:39 AM > > Advanced? MFC? > > See > int GetSystemMetrics( > int nIndex // system metric or configuration setting to retrieve > ); > > SM_CYCAPTION Height, in pixels, of normal caption area. > SM_CYMENU Height, in pixels, of single-line menu bar. > etc. > > Regards, > > Doug Brubacher > Doug Brubacher@compuware.com
Doug Brubacher -- Doug_Brubacher@compuware.com Tuesday, March 25, 1997 But what about the toolbar and status bar?"Open wide, good boy, here comes the spoon." These are simply windows. In fact you already have CWnd derived objects for them in your CMainframe class, CStatusBar m_wndStatusBar; CToolBar m_wndToolBar; See CWnd::GetWindowRect() Regards, Doug Brubacher
Doug Brubacher -- Doug_Brubacher@compuware.com Thursday, March 27, 1997 But what about the toolbar and status bar?"Open wide, good boy, here comes the spoon." These are simply windows. In fact you already have CWnd derived objects for them in your CMainframe class, CStatusBar m_wndStatusBar; CToolBar m_wndToolBar; See CWnd::GetWindowRect() Regards, Doug Brubacher
Become an MFC-L member | Вернуться в корень Архива |