Click here to Skip to main content
15,921,530 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 388.1K   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

 
AnswerRe: How to create a PaneView, the Form is in a DLL. [modified] Pin
HFHero.William2-Jun-06 5:54
HFHero.William2-Jun-06 5:54 
Tell everybody a good news!
I've resolved that problem.
At last,I creat Dialoges in dll with hParent which is passed from the exe(main window) as the parent window's handle.
And in that process,I must use MFC regular Dll, remember to add __stdcall before every function's declaration,include the typedefine of the function pointer(I call the Dll in obvious way(use LoadLibrary)).
Then you could set the style of the dialog in dll as "Child" and the border as "No border".
That's all. By the method I gived above,I can also create the dialogWindow like FormWindow in any CView class.Include CListView,CTreeView,CFormView and all those classes inherit from CView!
I think this is another way to reach the same result as the CUsefulSplitterWnd written by Mr Shaun,(am I right Mr Shaun?)Big Grin | :-D
Here today,I must thank to Mr Shaun for his idea.You're the pioneer,you give me directions.
Thank you Mr Shaun!
PS: What's the meaning of Shaun?I wanna know. Smile | :)
Could you please sent me E-mail if you don't care about it?

hfhero@msn.com
GeneralRe: How to create a PaneView, the Form is in a DLL. [modified] Pin
Shaun Wilde4-Jun-06 21:20
Shaun Wilde4-Jun-06 21:20 
GeneralI don't want to destroy existed view(formview) Pin
forhug3-Apr-06 4:57
forhug3-Apr-06 4:57 
GeneralRe: I don't want to destroy existed view(formview) Pin
Shaun Wilde3-Apr-06 7:22
Shaun Wilde3-Apr-06 7:22 
GeneralRe: I don't want to destroy existed view(formview) Pin
forhug3-Apr-06 18:52
forhug3-Apr-06 18:52 
AnswerRe: I don't want to destroy existed view(formview) [modified] Pin
ZeugmaBarter26-May-06 11:36
ZeugmaBarter26-May-06 11:36 
GeneralRe: I don't want to destroy existed view(formview) [modified] Pin
Shaun Wilde29-May-06 0:37
Shaun Wilde29-May-06 0:37 
QuestionRe: I don't want to destroy existed view(formview) Pin
bilsby27-Mar-08 6:17
bilsby27-Mar-08 6:17 
GeneralRe: I don't want to destroy existed view(formview) Pin
Shaun Wilde28-Mar-08 21:21
Shaun Wilde28-Mar-08 21:21 
GeneralRe: I don't want to destroy existed view(formview) Pin
PRMARJORAM30-Mar-09 3:54
PRMARJORAM30-Mar-09 3:54 
GeneralLittle ehancement Pin
Ratmangg25-Mar-04 23:03
Ratmangg25-Mar-04 23:03 
GeneralThanks Pin
sir kaber25-Dec-03 19:36
sir kaber25-Dec-03 19:36 
GeneralPrint & Print Preview with a splitter window Pin
WayneRC22-Sep-03 5:32
WayneRC22-Sep-03 5:32 
GeneralRe: Print & Print Preview with a splitter window Pin
Shaun Wilde22-Sep-03 10:31
Shaun Wilde22-Sep-03 10:31 
GeneralRe: Print & Print Preview with a splitter window Pin
WayneRC22-Sep-03 22:27
WayneRC22-Sep-03 22:27 
GeneralRe: Print & Print Preview with a splitter window Pin
Shaun Wilde22-Sep-03 22:50
Shaun Wilde22-Sep-03 22:50 
GeneralRe: Print & Print Preview with a splitter window Pin
WayneRC22-Sep-03 23:01
WayneRC22-Sep-03 23:01 
Generalhide the split bar Pin
ykuang10-Sep-03 23:26
ykuang10-Sep-03 23:26 
GeneralRe: hide the split bar Pin
Shaun Wilde11-Sep-03 7:50
Shaun Wilde11-Sep-03 7:50 
GeneralRe: hide the split bar Pin
qcha0s20-Aug-04 5:27
qcha0s20-Aug-04 5:27 
GeneralRe: hide the split bar Pin
Shaun Wilde22-Aug-04 6:19
Shaun Wilde22-Aug-04 6:19 
GeneralRe: hide the split bar Pin
qcha0s2-Sep-04 8:16
qcha0s2-Sep-04 8:16 
GeneralRe: hide the split bar Pin
Shaun Wilde2-Sep-04 9:50
Shaun Wilde2-Sep-04 9:50 
GeneralRe: hide the split bar Pin
qcha0s3-Sep-04 4:37
qcha0s3-Sep-04 4:37 
GeneralThanks so much Pin
Radha Nair2-Jul-03 21:03
Radha Nair2-Jul-03 21:03 

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.