分割窗口后(比如1x2),用鼠标可以拖动分隔线以调整两边视图大小,如何做才能使调整这个大小有一定的最小值,也就是说当鼠标拖动调整分割线使某视图小到一定程度就不能再小了?请教高手

解决方案 »

  1.   

    初始的大小可以在Create函数的参数里面设置sizeMin参数。
    要固定大小:可以试试下面的函数:
    SetRowInfo 和 SetColumnInfo
      

  2.   

    你可以重载OnSize,在里面SetRowInfo和SetColumnInfo,这样就可以固定视的大小了。
      

  3.   

    Derive a class from the CSplitterWnd and override the left button and mouse move messages: call the CWnd versions rather than CSplitterWnd versions. Finally, remove menu items that may generate ID_WINDOW_SPLIT commands. To add to the above answer, you should also handle the WM_SETCURSOR message and just call the CWnd version so that the horizontal and vertical resize pointers are not shown. BOOL CMySplitterWnd::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 

        return CWnd::OnSetCursor(pWnd, nHitTest, message); 
    } 更多信息参考:
    Q105150  "Preventing Static Splitters from Tracking"
    http://dev.csdn.net/develop/article/28/28430.shtm
      

  4.   

    我也想知道!!哈哈 
     To:hushuangyan74() 请问怎么在Create 中设置SizeMin啊?
     To: bluwindhrt(风一飞)  如果单独就用SetRowInfo 和 SetColumnInfo达不到效果,一到最小尺寸时,视图就会变成0。