如题!
左边窗口的Split条总是被拉来拉去的,很讨厌。
如何定长的把它给固定住?请指教!

解决方案 »

  1.   

    www.CodeProject.com上就完整例子
      

  2.   

    重载其中一个窗口的OnSize函数,调用MoveWindow()函数,并给定cx为某一个常数。.....
      

  3.   

    响应splitter窗口的OnLButtonDown,在里面直接返回
      

  4.   

    Restricting the size of a splitter 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;
    }