Skip to main content

Posts

Showing posts with the label MFC

Create Splitting Windows in VC 2005

Add two CSplitterWnd type variables into the MainFrame: CSplitterWnd m_wndSplitterLM; // split the window to left and middle panel // Than add the following code into the OnCreateClient Function: BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { // create a splitter with 1 row, 2 columns if (!m_wndSplitterLM.CreateStatic(this, 1, 2)) { TRACE("SpltLR create failed\n"); return false; } // add the first splitter pane - the default view in column 0 if (!m_wndSplitterLM.CreateView(0, 0, RUNTIME_CLASS(CMultiLayerTree), CSize(60, 0), pContext)) { TRACE0("Failed to create first pane\n"); return FALSE; } // add the second splitter pane - which splits the right window into two columns if (!m_wndSplitterMR.CreateStatic( &m_wndSplitterLM, // our parent window is the first splitter 1, 2, // the new splitter is 1 ...