我的项目是基于MDI的,我想请问怎么能在缩放主框架的同时实现子窗体的按比例缩放
在线等...

解决方案 »

  1.   

    在主框架的OnSize中发送WM_SIZE消息到子窗体(枚举子窗体)。
    在子窗体的OnSize函数中处理。
      

  2.   

    void CMainFrame::OnSize(UINT nType, int cx, int cy) 
    {
    CMDIFrameWnd::OnSize(nType, cx, cy);}这是主框架的OnSize,要怎么发送消息,怎么枚举呀,能说具体些吗?
      

  3.   

    可以用CDocument的成员函数
    //To get the first view in the list of views:POSITION pos = GetFirstViewPosition();
    CView* pFirstView = GetNextView( pos );
    // This example uses CDocument::GetFirstViewPosition
    // and GetNextView to repaint each view.
    void CMyDoc::OnRepaintAllViews()
    {
       POSITION pos = GetFirstViewPosition();
       while (pos != NULL)
       {
          CView* pView = GetNextView(pos);
          pView->UpdateWindow(); // 改为sendmessage(WM_SIZE,....)
       }   
    }
      

  4.   

    POSITION pos = GetFirstViewPosition();
    CView* pFirstView = GetNextView( pos );
    这两句要在那里定义呀? 还有,既然是按比例随着主框架缩放,那相对坐标的问题在哪里解决?怎么解决呀?