MFC窗口分割问题
以下是我重载的oncreateclient函数,BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr; GetWindowRect(&cr);
if(m_splitter.CreateStatic(this,1,2)==NULL)
return FALSE;
if(m_splitter2.CreateStatic(&m_splitter,2,1,WS_CHILD|WS_VISIBLE,
m_splitter.IdFromRowCol(0, 0))==NULL)
return FALSE;
m_splitter2.CreateView(0,0,RUNTIME_CLASS(Formview1),CSize(cr.Width()/2, cr.Height()/2),pContext);
m_splitter2.CreateView(1,0,RUNTIME_CLASS(Formview2),CSize(cr.Width()/2, cr.Height()/2),pContext);
if(m_splitter1.CreateStatic(&m_splitter,2,1,WS_CHILD|WS_VISIBLE,
m_splitter.IdFromRowCol(0, 1))==NULL)
return FALSE;
m_splitter1.CreateView(0,0,RUNTIME_CLASS(Formview3),CSize(cr.Width()/2, cr.Height()/2),pContext);
m_splitter1.CreateView(1,0,RUNTIME_CLASS(Formview4),CSize(cr.Width()/2, cr.Height()/2),pContext);
return TRUE;
}
其中Formview1,2,3,4是我的几个继承CFORMVIEW的对话框类,m_splitter,1,2是CSplitterWnd对象,现在出现的问题是
左边的分割窗格老是靠着最左边如图所示,而且各窗口大小并非如cr.Width()/2, cr.Height()/2设置的这样,求大神解读。。。
附件是结果的截图。。。。