在MFC主框架窗口中分割窗口

1.重载这个函数 OnCreateClientctrl+w打开类向导,添加CreatClient消息)
2.CMyView   继承一个civewBOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
	// TODO: 在此添加专用代码和/或调用基类
    
	m_splitterWnd.CreateStatic(this,1,3);

	m_splitterWnd.CreateView(0,0,RUNTIME_CLASS(CMyView),CSize(100,100),pContext);
	m_splitterWnd.CreateView(0,2,RUNTIME_CLASS(CMyFormView),CSize(100,100),pContext);

	m_splitterWnd.CreateView(0,1,RUNTIME_CLASS(CMyEditView),CSize(100,100),pContext);
	//m_splitter2.CreateStatic(&m_splitterWnd,0,1,WS_CHILD|WS_VISIBLE,m_splitterWnd.IdFromRowCol(0,1));
	//m_splitter2.CreateView(0,0,RUNTIME_CLASS(CMyEditView),CSize(100,100),pContext);

	return TRUE;
	//return CFrameWnd::OnCreateClient(lpcs, pContext);
}

你可能感兴趣的:(C++)