关于多文档、多视图结构,并且视图被分割成多个小视图。
谁有好的例子,能否给我发一份,或提供网址,谢谢。
[email protected]

解决方案 »

  1.   

    假设将整个视图分割成左右两个视图,
    你可以这样设置视图的宽度:
    m_wndSplitter.SetColumnInfo(0, 200, 0);//设置左边视图的宽度为200下面方法用于得到视图大小:
    CWnd* pWnd = m_wndSplitter.GetPane(0, 0);
    CLeftView* pView = DYNAMIC_DOWNCAST(CLeftView, pWnd);
    CRect rc;
    pView->GetClientRect(&rc);//得到左视图的大小下面方法用于设置按钮的大小,而且会自动调整:
    oid CLeftView::OnSize(UINT nType, int cx, int cy) 
    {
    CView::OnSize(nType, cx, cy);

    // TODO: Add your message handler code here
             //假设三个按钮是竖直一列放置
    pButton1->MoveWindow(0,0,cx, cy/3);
             pButton1->MoveWindow(0,cy/3,cx, cy/3);
             pButton1->MoveWindow(0,cy*2/3,cx, cy/3);
    }