Jump to content
  • Advertisement
Sign in to follow this  
Sfpiano

Insert a control into a splitter pane (MFC)

This topic is 4219 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!