用CSplitterWnd类,在MainFrm中申明变量 m_splitter
重载OnCreateClient函数
然后静态分割m_Splitter.CreateStatic( this, 1, 2 , WS_CHILD | WS_VISIBLE| WS_BORDER); 这时分成一行两列的
再创建视图 m_Splitter.CreateView(0, 0, RUNTIME_CLASS(CSplitWndView),CSize(100, 100), pContext);
例子:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
m_Splitter.CreateStatic( this, 1, 2 , WS_CHILD | WS_VISIBLE| WS_BORDER);
m_Splitter2.CreateStatic(&m_Splitter, 1, 3, WS_CHILD|WS_VISIBLE, m_Splitter.IdFromRowCol(0, 1) );
m_Splitter.CreateView(0, 0, RUNTIME_CLASS(CSplitWndView),CSize(100, 100), pContext);
m_Splitter2.CreateView(0, 0, RUNTIME_CLASS(CLeftTopView),CSize(400, 450), pContext);
m_Splitter2.CreateView(0, 1, RUNTIME_CLASS(CLeftBttmView),CSize(400, 450), pContext);
m_Splitter2.CreateView(0, 2, RUNTIME_CLASS(CThirdView),CSize(120, 100), pContext);
return true;
}