MFC 分栏

class CMainFrame : public CFrameWnd
{
public:

CSplitterWnd wndSplitter;

}

 

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
if(wndSplitter.CreateStatic(this,1,2)==NULL);
//if(wndSplitter.CreateStatic(this,1,2,WS_CHILD|WS_VISIBLE)==NULL);
wndSplitter.CreateView(0,0,RUNTIME_CLASS(CLeftView),CSize(100,100), pContext);
wndSplitter.CreateView(0,1,RUNTIME_CLASS(CRightView),CSize(100,100),pContext);
return true;
//return CFrameWnd::OnCreateClient(lpcs, pContext);
}

注意:最后一行必须注释;改为return ture

posted @ 2012-08-12 14:31  黑-色-柳—丁  阅读(368)  评论(0编辑  收藏  举报