Click here to Skip to main content
Licence CPOL
First Posted 24 Jan 2000
Views 268,430
Downloads 5,645
Bookmarked 51 times

CUsefulSplitterWnd (an extension to CSplitterWnd)

By | 24 Jan 2000 | Article
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)

About the Author

Shaun Wilde

Architect

United Kingdom United Kingdom

Member

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.
 
Been involved in programming from the early '80s. First on my Spectrum, then an Amstrad. Did lots of Fortran while at University before becoming involved in Forth, Prolog, Pascal, Occam, C and eventually C++. Eventually started programming on the Windows platform using Borland’s OWL framework, during my postgraduate years. When I started work in '94, I learnt MFC followed by COM and ATL and never looked back. Now working exclusively in .NET, working on WinForms, ASP.NET and the Compact Framework using C# and VB.NET. Using every bit of the .NET framework I can such as WebServices and writing my own controls for my .NET Portal, and for the Compact Framework. Still lots I don't know, but the end of the universe hasn't happened yet - I wonder if I'll have time?
 
I was a permanent employee for a number of companies until Dec 2000 before going independent after the DotCom I ws involved with went DotBomb. Now supplying consulting services to various institutions in London and surrounding regions i.e. UK Smile | :) .
 
Now living and working in Australia, trying to be involved in the local .NET and Agile communities. Also maintaining an open source code coverage tool called PartCover whilst thinking of developing a new one.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralOnInitialUpdate Pinmemberhellogany20:49 25 Apr '10  
GeneralRe: OnInitialUpdate PinmemberShaun Wilde1:34 27 Apr '10  
GeneralUse of ReplaceView from Inside of worker thread generate crasing. Pinmember"_$h@nky_"19:03 13 Oct '09  
GeneralRe: Use of ReplaceView from Inside of worker thread generate crasing. PinmemberShaun Wilde8:18 14 Oct '09  
GeneralRe: Use of ReplaceView from Inside of worker thread generate crasing. Pinmember"_$h@nky_"18:10 14 Oct '09  
GeneralRe: Use of ReplaceView from Inside of worker thread generate crasing. PinmemberShaun Wilde8:28 15 Oct '09  
GeneralOnInitialUpdate Function not working after replacing view. PinmemberThatsMe.19:12 3 Apr '08  
GeneralRe: OnInitialUpdate Function not working after replacing view. Pinmembersheeba.ph19:59 16 Jun '08  
GeneralRe: OnInitialUpdate Function not working after replacing view. Pinmember Shaun Wilde 8:50 17 Jun '08  
AnswerRe: OnInitialUpdate Function not working after replacing view. PinmemberAletheuein4:04 10 Aug '08  
AnswerRe: OnInitialUpdate Function not working after replacing view. Pinmemberwct19:22 7 Jan '09  
GeneralRe: OnInitialUpdate Function not working after replacing view. PinmemberShaun Wilde20:34 7 Jan '09  
GeneralRe: OnInitialUpdate Function not working after replacing view. Pinmemberwct4:13 10 Jan '09  
GeneralRe: OnInitialUpdate Function not working after replacing view. PinmemberVíctor Rodriguez-Doncel4:07 17 Jul '09  
GeneralSplit it into more parts [modified] Pinmemberneha.agarwal2720:15 16 Nov '06  
GeneralRe: Split it into more parts PinmemberShaun Wilde8:56 17 Nov '06  
GeneralCFormView from a DLL PinmemberAjay L D18:26 5 Nov '06  
GeneralRe: CFormView from a DLL PinmemberShaun Wilde8:53 17 Nov '06  
GeneralCSplitterWnd in SDI PinmemberBhushan198020:36 6 Jul '06  
GeneralRe: CSplitterWnd in SDI PinmemberShaun Wilde21:03 6 Jul '06  
QuestionHow to create a PaneView, the Form is in a DLL. PinmemberHFHero.William20:10 28 May '06  
AnswerRe: How to create a PaneView, the Form is in a DLL. PinmemberShaun Wilde0:35 29 May '06  
GeneralRe: How to create a PaneView, the Form is in a DLL. [modified] PinmemberHFHero.William5:55 29 May '06  
GeneralRe: How to create a PaneView, the Form is in a DLL. [modified] PinmemberShaun Wilde9:06 29 May '06  
GeneralRe: How to create a PaneView, the Form is in a DLL. [modified] PinmemberHFHero.William17:15 29 May '06  

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

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 25 Jan 2000
Article Copyright 2000 by Shaun Wilde
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid