---------
      |    view2
view1 |-----------
      |    view3
      |-----------
      |    view4
      |
我想使view4的高度固定,无论是整个窗口的大小改变,还是拖动view2与view3之间的切分条,view4的高度都不能改变!
我试了一下,用SetRowInfo函数,当整个窗口的大小改变时,view4的高度可以不变,但是当拖动view2与view3之间的切分条时,会影响到view4的高度,甚至view4不可见。

解决方案 »

  1.   

    I find the solution about restrict the size of the pane. First derive class XSplitterWnd from CSplitterWnd,
    Then handle the WM_ONSIZE,call the SetColInfo() and SetRowInfo() in OnSize function.
    And handle the WM_MOUSEMOVE and WM_SETCURSOR to prevent user from changing size.void XSplitterWnd::OnSize(UINT nType, int cx, int cy) 
    {
     RECT        rect;
     int         Height;
     GetClientRect( &rect );
            
     Height = rect.bottom - rect.top - 36;
            
     if ( m_pRowInfo != NULL )
      if ( Height < 0 )
       SetRowInfo( 0, 1, 1);
      else
       SetRowInfo( 0, Height, Height ); CSplitterWnd::OnSize(nType, cx, cy); // TODO: Add your message handler code here
    }void XSplitterWnd::OnMouseMove(UINT nFlags, CPoint point) 
    {
     // TODO: Add your message handler code here and/or call default
           
     //CSplitterWnd::OnMouseMove(nFlags, point);
    }void XSplitterWnd::OnLButtonDown(UINT nFlags, CPoint point) 
    {
     // TODO: Add your message handler code here and/or call default
            
     //CSplitterWnd::OnLButtonDown(nFlags, point);
    }BOOL XSplitterWnd::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
     // TODO: Add your message handler code here and/or call default
            
     //return CSplitterWnd::OnSetCursor(pWnd, nHitTest, message);
     return FALSE;
    }
      

  2.   

    明天来学习!下班了上面漏了一点,最好view3与view4之间的分割条被禁止!
      

  3.   

    to:laiyiling(陌生人!@#$%^&*) 我试了一下,没法实现我的要求,加上你的代码后,右边三个view中,上面一个view和最下面的view只能显示一个,如果右边只有2个view的话,可能可以做到。我的右边是三个view。
    具体怎么用呀?能不能给个例子!
      

  4.   

    laiyiling(陌生人!@#$%^&*) 
    的解答已经提供了思路,自己多琢磨,多试验一下就可以的!