我做了一个窗体分割的程序
首先是分成1行2列的,然后把第二列在分成2行1列的,不知道为什么我的第二列的2行1列分不出来的。有高手给我看看程序的,谢谢
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect rect; //´°Ì峤¶ÈÉèÖÃ
GetClientRect(&rect); //´´½¨´°Ìå1ÐÐ2ÁÐ
m_wndSplitter1.CreateStatic(this,1,2); //½«½«CMailViewÁ¬½Óµ½0ÐÐ0Áд°¸ñÉÏ
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CMailView), CSize(rect.Width()/5,rect.Height()),pContext);
//½«View1 Á¬½Óµ½0ÐÐ1Áд°¸ñÉÏ
m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CView1),CSize(rect.Width()-rect.Width()/5,rect.Height()), pContext); //½«View1´°Ìå·Ö¸î³É2ÐÐ1ÁÐ
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE, m_wndSplitter1.IdFromRowCol(0, 0)); //½«View2Á¬½Óµ½0ÐÐ0ÁÐ
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(rect.Width(),rect.Height()/3),pContext);
//½«View3Á¬½Óµ½1ÐÐ0ÁÐ
m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CView3),CSize(rect.Width(),rect.Height()-rect.Height()/3),pContext);
return true; //return CFrameWnd::OnCreateClient(lpcs, pContext);
}
首先是分成1行2列的,然后把第二列在分成2行1列的,不知道为什么我的第二列的2行1列分不出来的。有高手给我看看程序的,谢谢
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect rect; //´°Ì峤¶ÈÉèÖÃ
GetClientRect(&rect); //´´½¨´°Ìå1ÐÐ2ÁÐ
m_wndSplitter1.CreateStatic(this,1,2); //½«½«CMailViewÁ¬½Óµ½0ÐÐ0Áд°¸ñÉÏ
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CMailView), CSize(rect.Width()/5,rect.Height()),pContext);
//½«View1 Á¬½Óµ½0ÐÐ1Áд°¸ñÉÏ
m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CView1),CSize(rect.Width()-rect.Width()/5,rect.Height()), pContext); //½«View1´°Ìå·Ö¸î³É2ÐÐ1ÁÐ
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE, m_wndSplitter1.IdFromRowCol(0, 0)); //½«View2Á¬½Óµ½0ÐÐ0ÁÐ
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(rect.Width(),rect.Height()/3),pContext);
//½«View3Á¬½Óµ½1ÐÐ0ÁÐ
m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CView3),CSize(rect.Width(),rect.Height()-rect.Height()/3),pContext);
return true; //return CFrameWnd::OnCreateClient(lpcs, pContext);
}
http://topic.csdn.net/u/20090806/12/5bdf29bd-0d16-4e58-bf26-c531b46ae17b.html