0

I want to set the size of view according to the size of the mainframe in a SDI framework. That is to say when I change the size of mainframe, the size of view changes accordingly, so does the client area. How can I do this?

Thank you

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
user26404
  • 1,371
  • 4
  • 27
  • 38

1 Answers1

1

Just add an OnSize method to handle the sizing 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);
}
jussij
  • 10,370
  • 1
  • 33
  • 49