VC如何实现窗口的任意分割 各位大虾:单文档视图如何实现窗口的任意分割???附上代码! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 重写OnCreateClient虚函数BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext){ BOOL b1 = m_WndSplitter1.CreateStatic(this, 1,2); if( !b1 ) { TRACE("创建分隔条窗口失败\n"); AfxMessageBox("create splitwnd failed\n"); return FALSE; } BOOL b2 = m_WndSplitter1.CreateView( 0, 0, RUNTIME_CLASS(CLeftView), CSize(200,0), pContext) ; if( !b2 ) { m_WndSplitter1.DestroyWindow(); AfxMessageBox("create splitwnd failed\n"); return FALSE; } BOOL b3 = m_WndSplitter2.CreateStatic( &m_WndSplitter1, 2, 1, WS_CHILD | WS_VISIBLE, m_WndSplitter1.IdFromRowCol(0,1)); if( !b3 ) { m_WndSplitter1.DestroyWindow(); AfxMessageBox("create splitwnd failed\n"); return FALSE; } BOOL b4 = m_WndSplitter2.CreateView( 0, 0, RUNTIME_CLASS(CRightUpView), CSize(0, 320),pContext); if( !b4 ) { m_WndSplitter1.DestroyWindow(); m_WndSplitter2.DestroyWindow(); AfxMessageBox("create splitwnd failed\n"); return FALSE; } BOOL b5 = m_WndSplitter2.CreateView( 1, 0, RUNTIME_CLASS(CRightDownView), CSize(0, 180),pContext); if( !b5 ) { m_WndSplitter1.DestroyWindow(); m_WndSplitter2.DestroyWindow(); AfxMessageBox("create splitwnd failed\n"); return FALSE; } return TRUE; }分割成三个窗口,左,右上,右下。三个视图.类成员变量,两个分割条。 CSplitterWnd m_WndSplitter1; CSplitterWnd m_WndSplitter2; 要自己设置吧!你看看codeproject上面是否有现成的! MFC用户菜单权限问题?请高人指路…… C++ bmp旋转任意角度 但是不清晰。 在子类中,如何调用父类的成员函数? WTL 7.0中的几个例子程序编译通不过,请帮忙看看 ADO如何获取数据库中所有表名和表的所有字段名称及字段类型 求救vc++聊天室 系统煎切板只有一个? 请问电力行业/证券行业的曲线图,棒图,如何做,算法,最好有原代码 数据采集的问题 ****进程外服务器与客户程序间内存释放的讨论!**** 纯情善良的我,被小MM骗了。。。。。 我很伤心。。。 如何解决上述所报的错误?
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
BOOL b1 = m_WndSplitter1.CreateStatic(this, 1,2);
if( !b1 )
{
TRACE("创建分隔条窗口失败\n");
AfxMessageBox("create splitwnd failed\n");
return FALSE;
}
BOOL b2 = m_WndSplitter1.CreateView(
0, 0, RUNTIME_CLASS(CLeftView), CSize(200,0), pContext) ;
if( !b2 )
{
m_WndSplitter1.DestroyWindow();
AfxMessageBox("create splitwnd failed\n");
return FALSE;
}
BOOL b3 = m_WndSplitter2.CreateStatic(
&m_WndSplitter1, 2, 1,
WS_CHILD | WS_VISIBLE,
m_WndSplitter1.IdFromRowCol(0,1));
if( !b3 )
{
m_WndSplitter1.DestroyWindow();
AfxMessageBox("create splitwnd failed\n");
return FALSE;
} BOOL b4 = m_WndSplitter2.CreateView(
0, 0, RUNTIME_CLASS(CRightUpView), CSize(0, 320),pContext);
if( !b4 )
{
m_WndSplitter1.DestroyWindow();
m_WndSplitter2.DestroyWindow();
AfxMessageBox("create splitwnd failed\n");
return FALSE;
}
BOOL b5 = m_WndSplitter2.CreateView(
1, 0, RUNTIME_CLASS(CRightDownView), CSize(0, 180),pContext);
if( !b5 )
{
m_WndSplitter1.DestroyWindow();
m_WndSplitter2.DestroyWindow();
AfxMessageBox("create splitwnd failed\n");
return FALSE;
} return TRUE;
}
分割成三个窗口,左,右上,右下。
三个视图.
类成员变量,两个分割条。
CSplitterWnd m_WndSplitter1;
CSplitterWnd m_WndSplitter2;