Click to See Complete Forum and Search --> : Urgent


gajjela
April 4th, 1999, 04:38 PM
Thank You in advance for sparing your time. I have a Single document view.View is derived from CFormView. Now I need to resize the frame to exactly to the size of my view.



Looking for help.

Thank you
Gajjela

Walter I An
April 4th, 1999, 05:32 PM
I am not quite sure whether my method will work for your app.
I guess it will... But I have used in my dialog window and worked.

If you could get your formview size, use "CalcWindowRect()" function
which will return the size of window that is just big enough
to hold a given client rectanle size. Then use "SetWindowPos()"
function to resize your frame window.

Good luck. :)

Walter An

Dave Lorde
April 6th, 1999, 04:33 AM
Gajjela,

usually the view is sized to the frame...

Dave

darwen
January 30th, 2002, 11:48 PM
In your frame windows' OnSize :


void C....Wnd::OnSize(UINT nFlags, int cx, int cy)
{
// assumes view is m_pView
CFrameWnd::OnSize(nFlags, cx, cy);
CRect rectClient;
GetClientRect(&rectClient);
m_pView->MoveWindow(rectClient);
}




Darwen.