child frame fills main frame?
-
In MDI project. I want my child frame fill main frame window. So I inplement this in BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs CWnd* pwnd = AfxGetMainWnd(); CRect rect; pwnd->GetClientRect( &rect ); cs.cx = rect.Width(); cs.cy = rect.Height(); if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } It's very close to success. But look closely, you will find a bit off. main frame overlapped child frame a little bit. I think that is because of edge of main frame window. But I am getting client area, it should not include edge right? any one can explain? :confused:
-
In MDI project. I want my child frame fill main frame window. So I inplement this in BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs CWnd* pwnd = AfxGetMainWnd(); CRect rect; pwnd->GetClientRect( &rect ); cs.cx = rect.Width(); cs.cy = rect.Height(); if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } It's very close to success. But look closely, you will find a bit off. main frame overlapped child frame a little bit. I think that is because of edge of main frame window. But I am getting client area, it should not include edge right? any one can explain? :confused:
You have to do this inside
WM_CHILDACTIVATE
handler. Inside this handler call...MDIMaximize();
Jesus Loves:rose:
--Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose: