我在视图中声明了一个控件变量 m_rich,当窗体大小改变时候,控件的大小也改变,
在OnSize 中 用m_rich->Movewindow(&mRect,TRUE)出错,请教!!

解决方案 »

  1.   

    Example// Resize the list control contained in the view to
    // fill the entire view when the view's window is
    // resized. CMyView is a CView derived class.
    void CMyView::OnSize(UINT nType, int cx, int cy) 
    {
       CView::OnSize(nType, cx, cy);
       // Resize list to fill the whole view.
       m_List.MoveWindow (0, 0, cx, cy);
    }
    这是MSDN上面的例子,肯定没有错无的
    你肯定那里搞错了!
    在movewindow前一定要调用基类的ONSIZE函数!!
      

  2.   

    If the SetScrollPos or MoveWindow member function is called for a child window from OnSize, the bRedraw parameter of SetScrollPos or MoveWindow should be nonzero to cause the CWnd to be repainted