• Advertisement
Sign in to follow this  

Insert a control into a splitter pane (MFC)

This topic is 4045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't seem to figure out how to set a control (in my case a tree control) as the body of a splitter pane. I tried creating the parent splitter and then passing that as the parent in the create method of my control, but it didn't work.

Share this post


Link to post
Share on other sites
Advertisement
The CSplitterWnd only supports Views inside its panes.

Inside your OnCreateClient method you use CreateView to create a CTreeView inside a specific pane.

Sample from MSDN:


// this function creates the panes for a static splitter window
BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT lpcs,
CCreateContext* pContext)
{

BOOL bCreateSpltr = m_wndSplitter.CreateStatic( this, 2, 1);
// COneView and CAnotherView are user-defined views derived from CMDIView
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTreeView), CSize(0,0),
pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CEditView), CSize(0,0),
pContext);

return (bCreateSpltr);
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement