Click here to Skip to main content
15,886,110 members
Articles / Desktop Programming / MFC

CUsefulSplitterWnd (An Extension to CSplitterWnd)

Rate me:
Please Sign up or sign in to vote.
4.82/5 (26 votes)
24 Jan 2000CPOL 384.6K   8.1K   57   91
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Employed (other) Purplebricks
Australia Australia
All articles are supplied as-is, as a howto on a particular task that worked for me in the past. None of the articles are supposed to be out-of-the-box freeware controls and nor should they be treated as such. Caveat emptor.

Now living and working in Australia, trying to be involved in the local .NET and Agile communities when I can.

I spend a good chunk of my spare time building OpenCover and maintaining PartCover both of which are Code Coverage utilities for .NET.

Comments and Discussions

 
QuestionHow can I use SCROLL BARS with your Class Pin
30-Jun-01 10:18
suss30-Jun-01 10:18 
GeneralCongratulation Pin
24-May-01 11:42
suss24-May-01 11:42 
GeneralSWSplit Pin
20-May-01 6:18
suss20-May-01 6:18 
GeneralRe: SWSplit Pin
SAWilde15-Jun-01 3:26
SAWilde15-Jun-01 3:26 
GeneralRe: SWSplit Pin
Jeason Zhao18-Jun-01 20:15
Jeason Zhao18-Jun-01 20:15 
GeneralRe: SWSplit Pin
SAWilde18-Jun-01 21:49
SAWilde18-Jun-01 21:49 
GeneralChanging bitmaps Pin
18-Apr-01 19:05
suss18-Apr-01 19:05 
GeneralRe: Changing bitmaps Pin
SAWilde15-Jun-01 3:26
SAWilde15-Jun-01 3:26 
General3 panes Pin
Dora11-Jul-00 5:12
Dora11-Jul-00 5:12 
GeneralRe: 3 panes Pin
Shaun Wilde11-Jul-00 9:05
Shaun Wilde11-Jul-00 9:05 
GeneralProblem Pin
sdfsdfasdasd5-Jun-00 8:55
sdfsdfasdasd5-Jun-00 8:55 
GeneralRe: Problem Pin
Shaun Wilde11-Jul-00 8:59
Shaun Wilde11-Jul-00 8:59 
GeneralCUsefulSplitterWnd Problem with CTreeViews Pin
Sunil Kamat6-Feb-00 8:36
Sunil Kamat6-Feb-00 8:36 
GeneralRe: CUsefulSplitterWnd Problem with CTreeViews Pin
Shaun Wilde17-Feb-00 3:53
Shaun Wilde17-Feb-00 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.