Splitter View Problem in MFC.
-
Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//Create Splitter Window
m_wndSplitter.CreateStatic(this, 2, 1);
m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
return TRUE;
} -
Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//Create Splitter Window
m_wndSplitter.CreateStatic(this, 2, 1);
m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
return TRUE;
}I believe you need to create views for all the panes that you create. So after you create a splitter with
m_wndSplitter
having 2 rows, you need to create 2 views in these 2 rows before creating the next splitter withm_wndSplitter2
.«_Superman_» _I love work. It gives me something to do between weekends.
-
Following is the code which i wrote to implement a splitter view to join together 5 dialog. Problem is the split window at the bottom screen occupies the whole form area please help me to remove the error.
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//Create Splitter Window
m_wndSplitter.CreateStatic(this, 2, 1);
m_wndSplitter2.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (0, 0));
m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CFormLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CFormBottomLeft), CSize(200,100), pContext);
m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CFormBottomRight), CSize(200,100), pContext);
m_wndSplitter3.CreateStatic(&m_wndSplitter2, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSplitter2.IdFromRowCol (0, 1));
m_wndSplitter3.CreateView(0, 0, RUNTIME_CLASS(CFormRightUp), CSize(200,100), pContext);
m_wndSplitter3.CreateView(1, 0, RUNTIME_CLASS(CFormRightBottom), CSize(200,100), pContext);
return TRUE;
}Does [this] article help?
-
Does [this] article help?
Yup it helped. But actually what i did was to resize the dialog boxes after all the splitter controls were created.