Konrad
Konrad

Reputation: 41007

Splitting a already split pane (MFC)

In my MFC program I am using a splitter to create two panes. I now want to split one of these panes in half again and put in another view, can someone talk me through how to do it or point me in the direction of some code?

I would prefer to code it myself so I am not interested in custom derived classes unless they are extremely basic.

Thanks!

Upvotes: 3

Views: 2437

Answers (2)

Rob
Rob

Reputation: 78688

In CMainFrame::OnCreateClient

// Create splitter with 2 rows and 1 col
m_wndSplitter.CreateStatic(this, 2, 1);
// Create a view in the top row
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext);
// Create a 2 column splitter that will go in the bottom row of the first
m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(1, 0));
// Create views for the bottom splitter
m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CView2), CSize(100, 100), pContext); 
m_wndSplitter2.CreateView(0, 1, RUNTIME_CLASS(CView3), CSize(100, 100), pContext);
...

Upvotes: 6

pmlarocque
pmlarocque

Reputation: 1714

I am not an expert in MFC, but can't you just put a splitter in one of the panes you made with the first splitter ? that how we do in winform....

Upvotes: 0

Related Questions