How do I resize the view to fit the mainframe in the SDI structure?

I want to set the size of the view to match the size of the mainframe in the SDI framework. That is, when I resize the mainframe, the view resizes accordingly, just like the client area. How can i do this?

thank

0


source to share


1 answer


Just add an OnSize method to handle the size of the view:



void CMyFrame::OnSize(UINT nType, int cx, int cy)
{
  m_MyView.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
}

      

+1


source







All Articles