65.9K
CodeProject is changing. Read more.
Home

CUsefulSplitterWnd (An Extension to CSplitterWnd)

Jan 25, 2000

CPOL
viewsIcon

393320

downloadIcon

8077

An extension to MFCs CSplitterWnd that provides splitter locking and dynamic view replacement

The CUsefulSplitterWnd class presents two extensions to CSplitterWnd.

  1. The first extension is the ability to lock the bar in position so that it can no longer be moved.
     // bar is locked using LockBar(TRUE) 
    m_wndSplitter.LockBar(TRUE);  
    
    // and is unlocked using LockBar(FALSE) 
    m_wndSplitter.LockBar(FALSE);
    
  2. The second extension allows the views in each pane to be changed dynamically using the ReplaceView() method.
     // to replace a view in a pane you use ReplaceView 
    m_wndSplitter.ReplaceView(0,1,RUNTIME_CLASS(CForm1),CSize(100,100));
    

    This would replace the view in row 0, column 1 with CForm1 and with a minimum size of 100x100.