For dynamic splitters, this seems to be the designed behaviour, that is,
only one pane is displayed and the user splits the view.
Reading through the MFC source, however, you'll find the split member
SplitRow which indeed seems to be a better candidate for the split. This
function, however, depends on everything - the view, the document - already
being created. To postpone this call, but still have the splitter split
during startup, you might want to post a message from the frame to itself.
To do this, register a window message at the top of MainFrm.cpp, thus (lines
to add ended with <---):
const UINT RM_STARTUP_SPLIT = ::RegisterWindowMessage( "some long and unique
string goes here" ); <---
Add a handler for the message, in MainFrm.h:
afx_msg LRESULT OnStartupSplit( WPARAM, LPARAM ); <---
Add an entry into the message map so:
ON_REGISTERED_MESSAGE( RM_STARTUP_SPLIT, OnStartupSplit ) <---
And the handler itself (all of it):
LRESULT CMainFrame::OnStartupSplit( WPARAM, LPARAM )
m_wndSplitter.SplitRow( 50 );
Now, we want to get this function called after everything is finishen, which
we can do thus in CreateClient:
PostMessage( RM_STARTUP_SPLIT );
This will split the window into two rows, the first one being 50 pixels
high. Note that this value must be larger than the minimum size you declare
in Create for the splitter (or you can call SetRowInfo, which is -
This will at least give you some base for experimentation!
Abstrakt Mekanik AB
<email@example.com> a �crit dans le message de
> I wanted to set (for dynamic splitter) default size for the first row:
> As i understeand the first row should be 50 pixels height,
> but it is always 0. (i can see only next pane, i have to move the
> splitter down to see the first one).
> Why ?