   MFC window resizing not working
  I am having problems resizing my dialogbox in MFC. My window needs to be the same size as the bottom of a button + 10. When pressing the  button the window is resized to show an extra control which isn''t always needed. Moving it onto a different tab or in a new window isn''t really an option, since the control relies on a different one aswell.What is wrong with this code:  CRect WndSize;    CRect BtnPos;    // m_pgBlack is derived from CPropertyPage    m_pgBlack.m_btnCalendar.GetWindowRect(&BtnPos);    m_pgBlack.GetWindowRect(&WndSize);    ScreenToClient(&WndSize);    ScreenToClient(&BtnPos);    WndSize.right  -= WndSize.left;    WndSize.bottom = BtnPos.bottom;This is the result, I removed some of the interface, since I dunno if they would like it if I showed around the interface.
  What exactly is the code you use for setting the new size/position? ;  If you are not doing it already, check out CWnd::MoveWindow();   // Javelin-- Why do something today when you can do it tomorrow... -- ;  Oops, seems like I got the SetWindowPos(NULL, Rect.left, Rect.top, Rect.right, Rect.bottom, SWP_NOZORDER); call. I am resizing the propertypage, can I use Movewindow for that aswell? I just try and see wat happens.Toolmaker   -Earth is 98% full. Please delete anybody you can. ;  As far as i know out of my head setwindowpos takes width and height, not right and bottom as 4th and 5th parameter?   [edited by - Endurion on February 20, 2004 2:05:46 PM]